mirror of https://github.com/arendst/Tasmota.git
Fix ESP32C3 ledlink
This commit is contained in:
parent
84249ca32f
commit
c1fa07dd51
|
@ -1452,7 +1452,9 @@ void DigitalWrite(uint32_t gpio_pin, uint32_t index, uint32_t state) {
|
||||||
if (PinUsed(gpio_pin, index)) {
|
if (PinUsed(gpio_pin, index)) {
|
||||||
uint32_t pin = Pin(gpio_pin, index) & 0x3F; // Fix possible overflow over 63 gpios
|
uint32_t pin = Pin(gpio_pin, index) & 0x3F; // Fix possible overflow over 63 gpios
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32C3
|
#ifdef CONFIG_IDF_TARGET_ESP32C3
|
||||||
gpio_hold_dis((gpio_num_t)pin); // Allow state change
|
if (GPIO_REL1 == gpio_pin) {
|
||||||
|
gpio_hold_dis((gpio_num_t)pin); // Allow state change
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!bitRead(pinmode_init[pin / 32], pin % 32)) {
|
if (!bitRead(pinmode_init[pin / 32], pin % 32)) {
|
||||||
bitSet(pinmode_init[pin / 32], pin % 32);
|
bitSet(pinmode_init[pin / 32], pin % 32);
|
||||||
|
@ -1460,7 +1462,9 @@ void DigitalWrite(uint32_t gpio_pin, uint32_t index, uint32_t state) {
|
||||||
}
|
}
|
||||||
digitalWrite(pin, state &1);
|
digitalWrite(pin, state &1);
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32C3
|
#ifdef CONFIG_IDF_TARGET_ESP32C3
|
||||||
gpio_hold_en((gpio_num_t)pin); // Retain the state when the chip or system is reset, for example, when watchdog time-out or Deep-sleep
|
if (GPIO_REL1 == gpio_pin) {
|
||||||
|
gpio_hold_en((gpio_num_t)pin); // Retain the state when the chip or system is reset, for example, when watchdog time-out or Deep-sleep
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue