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