mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Update ir_protocols_main.c
RMT write should be non-blocking to wait the correct time for sending the repeat frame
This commit is contained in:
parent
23c62a4225
commit
a63a0be6ed
@ -99,12 +99,12 @@ static void example_ir_tx_task(void *arg)
|
||||
ESP_ERROR_CHECK(ir_builder->build_frame(ir_builder, addr, cmd));
|
||||
ESP_ERROR_CHECK(ir_builder->get_result(ir_builder, &items, &length));
|
||||
//To send data according to the waveform items.
|
||||
rmt_write_items(example_tx_channel, items, length, true);
|
||||
rmt_write_items(example_tx_channel, items, length, false);
|
||||
// Send repeat code
|
||||
vTaskDelay(pdMS_TO_TICKS(ir_builder->repeat_period_ms));
|
||||
ESP_ERROR_CHECK(ir_builder->build_repeat_frame(ir_builder));
|
||||
ESP_ERROR_CHECK(ir_builder->get_result(ir_builder, &items, &length));
|
||||
rmt_write_items(example_tx_channel, items, length, true);
|
||||
rmt_write_items(example_tx_channel, items, length, false);
|
||||
cmd++;
|
||||
}
|
||||
ir_builder->del(ir_builder);
|
||||
|
Loading…
x
Reference in New Issue
Block a user