From 6ee497b55df872d501ee82c62b50bf3843f59c09 Mon Sep 17 00:00:00 2001 From: custodey Date: Sat, 22 Jun 2024 10:49:37 +0300 Subject: [PATCH] rmt_config_t config Initialization with {} Otherwise sometimes the "NACK" error appears --- src/esp32DHT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/esp32DHT.cpp b/src/esp32DHT.cpp index 7a574e2..742dd57 100644 --- a/src/esp32DHT.cpp +++ b/src/esp32DHT.cpp @@ -43,7 +43,7 @@ DHT::~DHT() { void DHT::setup(uint8_t pin, rmt_channel_t channel) { _pin = pin; _channel = channel; - rmt_config_t config; + rmt_config_t config{}; config.rmt_mode = RMT_MODE_RX; config.channel = _channel; config.gpio_num = static_cast(_pin);