Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9bc877 commit a854da3Copy full SHA for a854da3
ports/esp32s2/common-hal/microcontroller/Pin.c
@@ -96,7 +96,7 @@ void reset_all_pins(void) {
96
}
97
98
void claim_pin(const mcu_pin_obj_t* pin) {
99
- in_use[pin->number / 32] |= (1 << pin->number % 32);
+ in_use[pin->number / 32] |= (1 << (pin->number % 32));
100
#ifdef MICROPY_HW_NEOPIXEL
101
if (pin == MICROPY_HW_NEOPIXEL) {
102
neopixel_in_use = true;
@@ -116,7 +116,7 @@ bool pin_number_is_free(gpio_num_t pin_number) {
116
#endif
117
118
uint8_t offset = pin_number / 32;
119
- uint8_t mask = 1 << pin_number % 32;
+ uint32_t mask = 1 << (pin_number % 32);
120
return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0;
121
122
0 commit comments