From f6c90adb42bb12d403bc027e247c791d16e04941 Mon Sep 17 00:00:00 2001 From: DeeFuse <7376678+Dee-Fuse@users.noreply.github.com> Date: Tue, 11 Feb 2020 19:59:56 +0100 Subject: [PATCH 1/3] Update ir_protocols_main.c RMT write should be non-blocking to wait the correct time for sending the repeat frame --- .../peripherals/rmt/ir_protocols/main/ir_protocols_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/peripherals/rmt/ir_protocols/main/ir_protocols_main.c b/examples/peripherals/rmt/ir_protocols/main/ir_protocols_main.c index a2da0b144e..b9fa721b4d 100644 --- a/examples/peripherals/rmt/ir_protocols/main/ir_protocols_main.c +++ b/examples/peripherals/rmt/ir_protocols/main/ir_protocols_main.c @@ -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); From 8954c989f4866ad3d72c59a00bc5296084596ecd Mon Sep 17 00:00:00 2001 From: DeeFuse <7376678+Dee-Fuse@users.noreply.github.com> Date: Tue, 11 Feb 2020 20:17:57 +0100 Subject: [PATCH 2/3] Update ir_builder_rmt_nec.c fixes standard protocol mode wich would fail due to integer promotion in inversion Merges https://github.com/espressif/esp-idf/pull/4750 --- .../components/infrared_tools/src/ir_builder_rmt_nec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/peripherals/rmt/ir_protocols/components/infrared_tools/src/ir_builder_rmt_nec.c b/examples/peripherals/rmt/ir_protocols/components/infrared_tools/src/ir_builder_rmt_nec.c index 571d7eab45..3b41e9eeb6 100644 --- a/examples/peripherals/rmt/ir_protocols/components/infrared_tools/src/ir_builder_rmt_nec.c +++ b/examples/peripherals/rmt/ir_protocols/components/infrared_tools/src/ir_builder_rmt_nec.c @@ -102,10 +102,10 @@ static esp_err_t nec_build_frame(ir_builder_t *builder, uint32_t address, uint32 if (!nec_builder->flags & IR_TOOLS_FLAGS_PROTO_EXT) { uint8_t low_byte = address & 0xFF; uint8_t high_byte = (address >> 8) & 0xFF; - NEC_CHECK(low_byte == ~high_byte, "address not match standard NEC protocol", err, ESP_ERR_INVALID_ARG); + NEC_CHECK(low_byte == (~high_byte & 0xFF), "address not match standard NEC protocol", err, ESP_ERR_INVALID_ARG); low_byte = command & 0xFF; high_byte = (command >> 8) & 0xFF; - NEC_CHECK(low_byte == ~high_byte, "command not match standard NEC protocol", err, ESP_ERR_INVALID_ARG); + NEC_CHECK(low_byte == (~high_byte & 0xFF), "command not match standard NEC protocol", err, ESP_ERR_INVALID_ARG); } builder->make_head(builder); // LSB -> MSB From bd8baba0dc600b6756c5d3da834880a3b7a9a90d Mon Sep 17 00:00:00 2001 From: morris Date: Fri, 14 Feb 2020 12:36:07 +0800 Subject: [PATCH 3/3] rmt: fix missing 0x in rmt_ll.h Closes https://github.com/espressif/esp-idf/issues/4760 --- components/soc/esp32/include/hal/rmt_ll.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/soc/esp32/include/hal/rmt_ll.h b/components/soc/esp32/include/hal/rmt_ll.h index 821bd5291d..1749b2be37 100644 --- a/components/soc/esp32/include/hal/rmt_ll.h +++ b/components/soc/esp32/include/hal/rmt_ll.h @@ -225,21 +225,21 @@ static inline uint32_t rmt_ll_get_tx_end_interrupt_status(rmt_dev_t *dev) { uint32_t status = dev->int_st.val; return ((status & 0x01) >> 0) | ((status & 0x08) >> 2) | ((status & 0x40) >> 4) | ((status & 0x200) >> 6) | - ((status & 0x1000) >> 8) | ((status & 0x8000) >> 10) | ((status & 40000) >> 12) | ((status & 0x200000) >> 14); + ((status & 0x1000) >> 8) | ((status & 0x8000) >> 10) | ((status & 0x40000) >> 12) | ((status & 0x200000) >> 14); } static inline uint32_t rmt_ll_get_rx_end_interrupt_status(rmt_dev_t *dev) { uint32_t status = dev->int_st.val; return ((status & 0x02) >> 1) | ((status & 0x10) >> 3) | ((status & 0x80) >> 5) | ((status & 0x400) >> 7) | - ((status & 0x2000) >> 9) | ((status & 0x10000) >> 11) | ((status & 80000) >> 13) | ((status & 0x400000) >> 15); + ((status & 0x2000) >> 9) | ((status & 0x10000) >> 11) | ((status & 0x80000) >> 13) | ((status & 0x400000) >> 15); } static inline uint32_t rmt_ll_get_err_interrupt_status(rmt_dev_t *dev) { uint32_t status = dev->int_st.val; return ((status & 0x04) >> 2) | ((status & 0x20) >> 4) | ((status & 0x100) >> 6) | ((status & 0x800) >> 8) | - ((status & 0x4000) >> 10) | ((status & 0x20000) >> 12) | ((status & 100000) >> 14) | ((status & 0x800000) >> 16); + ((status & 0x4000) >> 10) | ((status & 0x20000) >> 12) | ((status & 0x100000) >> 14) | ((status & 0x800000) >> 16); } static inline uint32_t rmt_ll_get_tx_thres_interrupt_status(rmt_dev_t *dev)