This commit is contained in:
gemu2015 2021-02-15 17:26:55 +01:00
parent f6572a863b
commit 95bdb15ae9
2 changed files with 3 additions and 3 deletions

View File

@ -1338,7 +1338,7 @@ int ICACHE_RAM_ATTR Pin(uint32_t gpio, uint32_t index) {
bool PinUsed(uint32_t gpio, uint32_t index = 0); bool PinUsed(uint32_t gpio, uint32_t index = 0);
bool PinUsed(uint32_t gpio, uint32_t index) { bool PinUsed(uint32_t gpio, uint32_t index) {
return (Pin(gpio, index) > -1); return (Pin(gpio, index) >= 0);
} }
uint32_t GetPin(uint32_t lpin) { uint32_t GetPin(uint32_t lpin) {

View File

@ -412,7 +412,7 @@ void SetLedLink(uint32_t state)
if (-1 == led_pin) { // Legacy - LED1 is status if (-1 == led_pin) { // Legacy - LED1 is status
SetLedPowerIdx(0, state); SetLedPowerIdx(0, state);
} }
else if (led_pin > -1) { else if (led_pin >= 0) {
if (state) { state = 1; } if (state) { state = 1; }
digitalWrite(led_pin, (led_inv) ? !state : state); digitalWrite(led_pin, (led_inv) ? !state : state);
} }