Skip to content

Commit 1e4d5bf

Browse files
authored
[Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994)
* RMT IDF5.1 refactoring * Fixes initial value setting * removed rmtRead() with user callback * simplify/remove Read data structure * Deep API simplification * fixes the examples * fix rmt.h * adds support to APB different frequencies * fixes CI and not defined RGB_BUILTIN * new RMT API and examples * fixing commentaties * Update esp32-hal-rgb-led.c * changes Filter API * Fixes example with Filter API
1 parent 8a179e6 commit 1e4d5bf

File tree

9 files changed

+1237
-879
lines changed

9 files changed

+1237
-879
lines changed

cores/esp32/esp32-hal-rgb-led.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@
33

44
void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val){
55
rmt_data_t led_data[24];
6-
static rmt_obj_t* rmt_send = NULL;
76
static bool initialized = false;
87

98
uint8_t _pin = pin;
109
#ifdef RGB_BUILTIN
1110
if(pin == RGB_BUILTIN){
12-
_pin = RGB_BUILTIN-SOC_GPIO_PIN_COUNT;
11+
_pin = RGB_BUILTIN - SOC_GPIO_PIN_COUNT;
1312
}
1413
#endif
1514

1615
if(!initialized){
17-
if((rmt_send = rmtInit(_pin, RMT_TX_MODE, RMT_MEM_64)) == NULL){
16+
if (!rmtInit(_pin, RMT_TX_MODE, RMT_MEM_NUM_BLOCKS_1, 10000000)){
1817
log_e("RGB LED driver initialization failed!");
19-
rmt_send = NULL;
2018
return;
2119
}
22-
rmtSetTick(rmt_send, 100);
2320
initialized = true;
2421
}
2522

@@ -43,5 +40,5 @@ void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue
4340
i++;
4441
}
4542
}
46-
rmtWrite(rmt_send, led_data, 24);
43+
rmtWrite(_pin, led_data, RMT_SYMBOLS_OF(led_data), RMT_WAIT_FOR_EVER);
4744
}

0 commit comments

Comments
 (0)