Skip to content

Commit 157c694

Browse files
committed
fix the indent
1 parent 1d086a1 commit 157c694

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

components/esp-zigbee-ncp/src/esp_ncp_bus.c

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ static esp_err_t ncp_bus_init_hdl(uint8_t transport)
5757
uart_driver_install(CONFIG_NCP_BUS_UART_NUM, NCP_BUS_BUF_SIZE * 2, NCP_BUS_BUF_SIZE * 2, 20, &uart0_queue, 0);
5858
uart_param_config(CONFIG_NCP_BUS_UART_NUM, &uart_config);
5959
uart_set_pin(CONFIG_NCP_BUS_UART_NUM, CONFIG_NCP_BUS_UART_TX_PIN, CONFIG_NCP_BUS_UART_RX_PIN, CONFIG_NCP_BUS_UART_RTS_PIN, CONFIG_NCP_BUS_UART_CTS_PIN);
60-
// configure a SLIP framing detector
60+
// configure a SLIP framing detector
6161
esp_err_t err = uart_enable_pattern_det_baud_intr(CONFIG_NCP_BUS_UART_NUM, SLIP_END, 1, 1, 0, 0);
62-
if (err != ESP_OK) {
63-
ESP_LOGE(TAG, "uart_enable_pattern_det_baud_intr failed");
64-
return err;
65-
}
62+
if (err != ESP_OK) {
63+
ESP_LOGE(TAG, "uart_enable_pattern_det_baud_intr failed");
64+
return err;
65+
}
6666
return ESP_OK;
6767
}
6868

@@ -94,22 +94,20 @@ static void esp_ncp_bus_task(void *pvParameter)
9494
uart_flush_input(CONFIG_NCP_BUS_UART_NUM);
9595
xQueueReset(uart0_queue);
9696
break;
97-
case UART_PATTERN_DET:
98-
ESP_LOGI(TAG, "uart pattern detection");
99-
int pos;
100-
do {
101-
pos = uart_pattern_pop_pos(CONFIG_NCP_BUS_UART_NUM);
102-
ESP_LOGI(TAG, "uart pattern pos: %d", pos);
103-
if (pos > 0) {
104-
// here we have the position of an END marker at the end (>0) of a frame
105-
ncp_event.size = uart_read_bytes(CONFIG_NCP_BUS_UART_NUM, dtmp, pos + 1, portMAX_DELAY);
106-
ESP_LOG_BUFFER_HEX_LEVEL(TAG, dtmp, ncp_event.size, ESP_LOG_INFO);
107-
xStreamBufferSend(bus->output_buf, dtmp, ncp_event.size, 0);
108-
esp_ncp_send_event(&ncp_event);
109-
break; // one frame at a time
110-
}
111-
} while (pos >= 0);
112-
break;
97+
case UART_PATTERN_DET:
98+
ESP_LOGI(TAG, "uart pattern detection");
99+
int pos;
100+
do {
101+
pos = uart_pattern_pop_pos(CONFIG_NCP_BUS_UART_NUM);
102+
if (pos > 0) {
103+
// here we have the position of an END marker at the end (>0) of a frame
104+
ncp_event.size = uart_read_bytes(CONFIG_NCP_BUS_UART_NUM, dtmp, pos + 1, portMAX_DELAY);
105+
xStreamBufferSend(bus->output_buf, dtmp, ncp_event.size, 0);
106+
esp_ncp_send_event(&ncp_event);
107+
break; // one frame at a time
108+
}
109+
} while (pos >= 0);
110+
break;
113111
default:
114112
ESP_LOGI(TAG, "uart event type: %d", event.type);
115113
break;

0 commit comments

Comments
 (0)