nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.64k stars 3.12k forks source link

Explicitly set RMT config::flags. #3521

Closed h2zero closed 2 years ago

h2zero commented 2 years ago

If this variable is not set in the config it may contain random data and set the clock source to the REF_CLK resulting in timing errors, the DHTx, DS18B20 and ws2812 devices to not communicate.

jmattsson commented 2 years ago

We should probably either memset(ptr, 0, size) these structs, or make use of automatic zero-fill of partially initialised structs, but I'm happy to get this set of minimal fixes in now. Thanks for the PR!

h2zero commented 2 years ago

I think all the other parameters are set, this is just a new one for IDF v4.x. There are also macros for RMT_DEFAULT_CONFIG_TX and RMT_DEFAULT_CONFIG_RX that could be used here.

jmattsson commented 2 years ago

@h2zero Oooh, that would be even more future-proof! If you want to PR it, just tag me as a reviewer and I can get it merged. I'm a bit overloaded with stuff at the moment, so I only see things that directly mention me.