@@ -93,6 +93,9 @@ static void IRAM_ATTR machine_bitstream_high_low_bitbang(mp_hal_pin_obj_t pin, u
9393/******************************************************************************/
9494// RMT implementation
9595
96+ #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL (5 ,3 ,0 )
97+ #include "rmt_private.h" //RJS need to add rmt_private path in _common.cmake
98+ #endif
9699#include "driver/rmt_tx.h"
97100#include "driver/rmt_encoder.h"
98101
@@ -147,14 +150,16 @@ static void machine_bitstream_high_low_rmt(mp_hal_pin_obj_t pin, uint32_t *timin
147150 rmt_encoder_reset (encoder );
148151 check_esp_err (rmt_transmit (channel , encoder , buf , len , & tx_config ));
149152
150- // Wait 50% longer than we expect (if every bit takes the maximum time).
151- uint32_t timeout_ms = (3 * len / 2 ) * (1 + (8 * MAX (timing_ns [0 ] + timing_ns [1 ], timing_ns [2 ] + timing_ns [3 ])) / 1000000 ) + 9 ;
152- check_esp_err (rmt_tx_wait_all_done (channel , timeout_ms ));
153+ check_esp_err (rmt_tx_wait_all_done (channel , -1 ));
153154
154155 // Disable and release channel.
155156 check_esp_err (rmt_del_encoder (encoder ));
156157 rmt_disable (channel );
157- rmt_del_channel (channel );
158+ #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL (5 ,3 ,0 )
159+ channel -> del (channel );
160+ #else
161+ rmt_del_channel (channel ); // RJS untested
162+ #endif
158163
159164 // Cancel RMT output to GPIO pin.
160165 esp_rom_gpio_connect_out_signal (pin , SIG_GPIO_OUT_IDX , false, false);
0 commit comments