I wont use any other event.type.
Code: Select all
while (1) {
if (xQueueReceive(m_uart_queue, (void *)&event, 10 / portTICK_PERIOD_MS)) {
if (event.type == UART_DATA) {
uint32_t len = bufferEnd - ptr;
if (len > event.size) len = event.size;
int ret = uart_read_bytes(MODULE_UART_NUM, (uint8_t *) ptr, len, 10);
if (ret > 0) {
...
}
}
}
}
Code: Select all
while (1) {
uint32_t len = 1;
int ret = uart_read_bytes(MODULE_UART_NUM, (uint8_t *) ptr, len, 10 / portTICK_PERIOD_MS);
if (ret > 0) {
...
}
}