uart: format driver code by astyle
@@ -869,8 +869,7 @@ static void UART_ISR_ATTR uart_rx_intr_handler_default(void *param)
UART_EXIT_CRITICAL_ISR(&(uart_context[uart_num].spinlock));
}
}
- }
- else if ((uart_intr_status & UART_INTR_RXFIFO_TOUT)
+ } else if ((uart_intr_status & UART_INTR_RXFIFO_TOUT)
|| (uart_intr_status & UART_INTR_RXFIFO_FULL)
|| (uart_intr_status & UART_INTR_CMD_CHAR_DET)
) {
@@ -1437,9 +1436,13 @@ esp_err_t uart_driver_install(uart_port_t uart_num, int rx_buffer_size, int tx_b
uart_hal_disable_intr_mask(&(uart_context[uart_num].hal), UART_LL_INTR_MASK);
uart_hal_clr_intsts_mask(&(uart_context[uart_num].hal), UART_LL_INTR_MASK);
r = uart_isr_register(uart_num, uart_rx_intr_handler_default, p_uart_obj[uart_num], intr_alloc_flags, &p_uart_obj[uart_num]->intr_handle);
- if (r!=ESP_OK) goto err;
+ if (r != ESP_OK) {
+ goto err;
+ }
r = uart_intr_config(uart_num, &uart_intr);
- if (r!=ESP_OK) goto err;
+ if (r != ESP_OK) {
+ goto err;
+ }
return r;
err:
@@ -1606,9 +1609,7 @@ esp_err_t uart_get_collision_flag(uart_port_t uart_num, bool* collision_flag)
ESP_RETURN_ON_FALSE((uart_num < UART_NUM_MAX), ESP_ERR_INVALID_ARG, UART_TAG, "uart_num error");
ESP_RETURN_ON_FALSE((p_uart_obj[uart_num]), ESP_FAIL, UART_TAG, "uart driver error");
ESP_RETURN_ON_FALSE((collision_flag != NULL), ESP_ERR_INVALID_ARG, UART_TAG, "wrong parameter pointer");
- ESP_RETURN_ON_FALSE(
- (UART_IS_MODE_SET(uart_num, UART_MODE_RS485_HALF_DUPLEX)
- || UART_IS_MODE_SET(uart_num, UART_MODE_RS485_COLLISION_DETECT)),
+ ESP_RETURN_ON_FALSE((UART_IS_MODE_SET(uart_num, UART_MODE_RS485_HALF_DUPLEX) || UART_IS_MODE_SET(uart_num, UART_MODE_RS485_COLLISION_DETECT)),
ESP_ERR_INVALID_ARG, UART_TAG, "wrong mode");
*collision_flag = p_uart_obj[uart_num]->coll_det_flg;
return ESP_OK;
@@ -1617,8 +1618,7 @@ esp_err_t uart_get_collision_flag(uart_port_t uart_num, bool* collision_flag)
esp_err_t uart_set_wakeup_threshold(uart_port_t uart_num, int wakeup_threshold)
{
ESP_RETURN_ON_FALSE((uart_num < UART_NUM_MAX), ESP_ERR_INVALID_ARG, UART_TAG, "uart_num error");
- ESP_RETURN_ON_FALSE((wakeup_threshold <= UART_ACTIVE_THRESHOLD_V &&
- wakeup_threshold > UART_MIN_WAKEUP_THRESH), ESP_ERR_INVALID_ARG, UART_TAG,
+ ESP_RETURN_ON_FALSE((wakeup_threshold <= UART_ACTIVE_THRESHOLD_V && wakeup_threshold > UART_MIN_WAKEUP_THRESH), ESP_ERR_INVALID_ARG, UART_TAG,
"wakeup_threshold out of bounds");
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
uart_hal_set_wakeup_thrd(&(uart_context[uart_num].hal), wakeup_threshold);
