diff options
Diffstat (limited to 'ports/stm')
| -rw-r--r-- | ports/stm/common-hal/microcontroller/Pin.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 9fbdedead..996513270 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -70,6 +70,10 @@ void reset_all_pins(void) { // Mark pin as free and return it to a quiescent state. void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if ( pin_number == NO_PIN ) { + return; + } + if (pin_port == 0x0F) { return; } @@ -88,6 +92,9 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { } void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { + if ( pin_number == NO_PIN ) { + return; + } never_reset_pins[pin_port] |= 1<<pin_number; // Make sure never reset pins are also always claimed claimed_pins[pin_port] |= 1<<pin_number; |
