Skip to content

Commit b303cb4

Browse files
Update RMT initialization code (#8927)
* Update RMT initialization code - Commented out setting interrupt priority for both TX and RX configurations in the RMT initialization code. * checks IDF version within RMT interrupt priority --------- Co-authored-by: Rodrigo Garcia <[email protected]>
1 parent b01775e commit b303cb4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: cores/esp32/esp32-hal-rmt.c

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "esp32-hal-rmt.h"
2525
#include "esp32-hal-periman.h"
26+
#include "esp_idf_version.h"
2627

2728
// Arduino Task Handle indicates if the Arduino Task has been started already
2829
extern TaskHandle_t loopTaskHandle;
@@ -513,7 +514,9 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_
513514
tx_cfg.flags.with_dma = 0;
514515
tx_cfg.flags.io_loop_back = 0;
515516
tx_cfg.flags.io_od_mode = 0;
517+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 2)
516518
tx_cfg.intr_priority = 0;
519+
#endif
517520

518521
if (rmt_new_tx_channel(&tx_cfg, &bus->rmt_channel_h) != ESP_OK) {
519522
log_e("GPIO %d - RMT TX Initialization error.", pin);
@@ -538,7 +541,9 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_
538541
rx_cfg.flags.invert_in = 0;
539542
rx_cfg.flags.with_dma = 0;
540543
rx_cfg.flags.io_loop_back = 0;
544+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 2)
541545
rx_cfg.intr_priority = 0;
546+
#endif
542547
// try to allocate the RMT Channel
543548
if (ESP_OK != rmt_new_rx_channel(&rx_cfg, &bus->rmt_channel_h)) {
544549
log_e("GPIO %d RMT - RX Initialization error.", pin);

0 commit comments

Comments
 (0)