Skip to content

Commit 1fa09fa

Browse files
authored
Merge pull request #5487 from nvlsianpu/bugfix_5462_initial_pin_value
Fix bug for issue: initial pin value not retained
2 parents 114e019 + edb8650 commit 1fa09fa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

targets/TARGET_NORDIC/TARGET_NRF5/gpio_api.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
typedef struct {
3434
bool used_as_gpio : 1;
3535
PinDirection direction : 1;
36-
bool init_high : 1;
3736
PinMode pull : 2;
3837
bool used_as_irq : 1;
3938
bool irq_fall : 1;
@@ -156,7 +155,7 @@ static void gpio_apply_config(uint8_t pin)
156155
}
157156
else {
158157
// Configure as output.
159-
nrf_drv_gpiote_out_config_t cfg = GPIOTE_CONFIG_OUT_SIMPLE(m_gpio_cfg[pin].init_high);
158+
nrf_drv_gpiote_out_config_t cfg = GPIOTE_CONFIG_OUT_SIMPLE(nrf_gpio_pin_out_read(pin));
160159
nrf_drv_gpiote_out_init(pin, &cfg);
161160
}
162161
m_gpio_initialized |= ((gpio_mask_t)1UL << pin);

0 commit comments

Comments
 (0)