However, when moving from one task to another, my buffer gets filled and my algorithms can't proceed with this fault because I take the length which comes from
Code: Select all
uart_read_bytes()
I move from the first task to the second task when an interrupt triggers and I pause the first task while proceeding with the second task.
while first task running the uart length I receive starts from zero. But when I moved to the second task it starts from 255 (and it doesn't change even if I received some data). what is the workaround for this?
Code: Select all
uint8_t _length = uart_read_bytes(UART_NUM_1, data, PACKET_SIZE, 50 / portTICK_RATE_MS); //UART read bytes from UART buffer
ESP_LOGD(TAG, "received %d bytes", _length);
if (_length == PACKET_SIZE) //if 12 bytes received
Code: Select all
xTaskCreate(tree_intr_func, "tree interrupt task", 2048, NULL, 1, &intrHandle);
xTaskCreate(mango_scanning, "mango scanning task", 2048, NULL, 1, &mangoHandle);
Code: Select all
ESP_ERROR_CHECK(uart_flush(UART_NUM_1));
Can someone help me out