mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
parent
81d2527ff6
commit
f4adce5fb1
@ -372,8 +372,10 @@ const char kWebColors[] PROGMEM =
|
||||
|
||||
#ifdef ESP8266
|
||||
#define AGPIO(x) (x)
|
||||
#define BGPIO(x) (x)
|
||||
#else // ESP32
|
||||
#define AGPIO(x) (x<<5)
|
||||
#define BGPIO(x) (x>>5)
|
||||
#endif // ESP8266 - ESP32
|
||||
|
||||
#ifdef USE_DEVICE_GROUPS
|
||||
|
@ -188,12 +188,12 @@ bool DhtRead(uint32_t sensor)
|
||||
|
||||
bool DhtPinState()
|
||||
{
|
||||
if ((XdrvMailbox.index >= GPIO_DHT11) && (XdrvMailbox.index <= GPIO_SI7021)) {
|
||||
if ((XdrvMailbox.index >= AGPIO(GPIO_DHT11)) && (XdrvMailbox.index <= AGPIO(GPIO_SI7021))) {
|
||||
if (dht_sensors < DHT_MAX_SENSORS) {
|
||||
Dht[dht_sensors].pin = XdrvMailbox.payload;
|
||||
Dht[dht_sensors].type = XdrvMailbox.index;
|
||||
Dht[dht_sensors].type = BGPIO(XdrvMailbox.index);
|
||||
dht_sensors++;
|
||||
XdrvMailbox.index = GPIO_DHT11;
|
||||
XdrvMailbox.index = AGPIO(GPIO_DHT11);
|
||||
} else {
|
||||
XdrvMailbox.index = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user