Update ESP-IDF examples
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
#define BUF_SIZE (1024)
|
||||
|
||||
static void echo_task()
|
||||
static void echo_task(void *arg)
|
||||
{
|
||||
/* Configure parameters of an UART driver,
|
||||
* communication pins and install the driver */
|
||||
@@ -40,11 +40,12 @@ static void echo_task()
|
||||
.data_bits = UART_DATA_8_BITS,
|
||||
.parity = UART_PARITY_DISABLE,
|
||||
.stop_bits = UART_STOP_BITS_1,
|
||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE
|
||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
||||
.source_clk = UART_SCLK_APB,
|
||||
};
|
||||
uart_driver_install(UART_NUM_1, BUF_SIZE * 2, 0, 0, NULL, 0);
|
||||
uart_param_config(UART_NUM_1, &uart_config);
|
||||
uart_set_pin(UART_NUM_1, ECHO_TEST_TXD, ECHO_TEST_RXD, ECHO_TEST_RTS, ECHO_TEST_CTS);
|
||||
uart_driver_install(UART_NUM_1, BUF_SIZE * 2, 0, 0, NULL, 0);
|
||||
|
||||
// Configure a temporary buffer for the incoming data
|
||||
uint8_t *data = (uint8_t *) malloc(BUF_SIZE);
|
||||
@@ -57,7 +58,7 @@ static void echo_task()
|
||||
}
|
||||
}
|
||||
|
||||
void app_main()
|
||||
void app_main(void)
|
||||
{
|
||||
xTaskCreate(echo_task, "uart_echo_task", 1024, NULL, 10, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user