diff --git a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c index ad30d33121..e19988a7f7 100644 --- a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c @@ -95,7 +95,7 @@ digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( void common_hal_digitalio_digitalinout_set_value( digitalio_digitalinout_obj_t *self, bool value) { - HAL_GPIO_WritePin(pin_port(self->pin->number), 1 << self->pin->number, value); + HAL_GPIO_WritePin(pin_port(self->pin->number), pin_mask(self->pin->number), value); } bool common_hal_digitalio_digitalinout_get_value(