diff --git a/ports/rp2/machine_pin.c b/ports/rp2/machine_pin.c index 79f91232f7..8fdde114bd 100644 --- a/ports/rp2/machine_pin.c +++ b/ports/rp2/machine_pin.c @@ -297,7 +297,7 @@ static mp_obj_t machine_pin_obj_init_helper(const machine_pin_obj_t *self, size_ mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("invalid pin af: %d"), af); } gpio_set_function(self->id, af); - machine_pin_open_drain_mask &= ~(1 << self->id); + machine_pin_open_drain_mask &= ~(1ULL << self->id); } } @@ -379,7 +379,7 @@ static mp_obj_t machine_pin_low(mp_obj_t self_in) { } else if (GPIO_IS_OPEN_DRAIN(self->id)) { gpio_set_dir(self->id, GPIO_OUT); } else { - gpio_clr_mask(1u << self->id); + gpio_clr_mask64(1ULL << self->id); } return mp_const_none; } @@ -395,7 +395,7 @@ static mp_obj_t machine_pin_high(mp_obj_t self_in) { } else if (GPIO_IS_OPEN_DRAIN(self->id)) { gpio_set_dir(self->id, GPIO_IN); } else { - gpio_set_mask(1u << self->id); + gpio_set_mask64(1ULL << self->id); } return mp_const_none; } @@ -416,7 +416,7 @@ static mp_obj_t machine_pin_toggle(mp_obj_t self_in) { gpio_set_dir(self->id, GPIO_OUT); } } else { - gpio_xor_mask(1u << self->id); + gpio_xor_mask64(1ULL << self->id); } return mp_const_none; }