never_reset_pin: Move pin validity check before first use of pin number
This commit is contained in:
parent
6638bc32c3
commit
a770b5a919
@ -110,12 +110,12 @@ void never_reset_pin_number(uint8_t pin_number) {
|
||||
}
|
||||
|
||||
void reset_pin_number(uint8_t pin_number) {
|
||||
never_reset_pins[GPIO_PORT(pin_number)] &= ~(1 << GPIO_PIN(pin_number));
|
||||
|
||||
if (pin_number >= PORT_BITS) {
|
||||
return;
|
||||
}
|
||||
|
||||
never_reset_pins[GPIO_PORT(pin_number)] &= ~(1 << GPIO_PIN(pin_number));
|
||||
|
||||
#ifdef MICROPY_HW_NEOPIXEL
|
||||
if (pin_number == MICROPY_HW_NEOPIXEL->number) {
|
||||
neopixel_in_use = false;
|
||||
|
Loading…
Reference in New Issue
Block a user