mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ir_protocol: fix ir example timeout issue
More detail see https://esp32.com/viewtopic.php?f=25&t=18204
This commit is contained in:
parent
b0150615df
commit
138c1e278f
@ -47,10 +47,11 @@ static void example_ir_rx_task(void *arg)
|
||||
|
||||
//get RMT RX ringbuffer
|
||||
rmt_get_ringbuf_handle(example_rx_channel, &rb);
|
||||
assert(rb != NULL);
|
||||
// Start receive
|
||||
rmt_rx_start(example_rx_channel, true);
|
||||
while (rb) {
|
||||
items = (rmt_item32_t *) xRingbufferReceive(rb, &length, 1000);
|
||||
while (1) {
|
||||
items = (rmt_item32_t *) xRingbufferReceive(rb, &length, portMAX_DELAY);
|
||||
if (items) {
|
||||
length /= 4; // one RMT = 4 Bytes
|
||||
if (ir_parser->input(ir_parser, items, length) == ESP_OK) {
|
||||
@ -60,8 +61,6 @@ static void example_ir_rx_task(void *arg)
|
||||
}
|
||||
//after parsing the data, return spaces to ringbuffer.
|
||||
vRingbufferReturnItem(rb, (void *) items);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
ir_parser->del(ir_parser);
|
||||
|
Loading…
x
Reference in New Issue
Block a user