Merge pull request #5487 from nvlsianpu/bugfix_5462_initial_pin_value

Fix bug for issue:  initial pin value not retained
pull/5358/merge
Martin Kojtal 2017-11-16 16:13:13 +00:00 committed by GitHub
commit 1fa09fa43d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -33,7 +33,6 @@
typedef struct {
bool used_as_gpio : 1;
PinDirection direction : 1;
bool init_high : 1;
PinMode pull : 2;
bool used_as_irq : 1;
bool irq_fall : 1;
@ -156,7 +155,7 @@ static void gpio_apply_config(uint8_t pin)
}
else {
// Configure as output.
nrf_drv_gpiote_out_config_t cfg = GPIOTE_CONFIG_OUT_SIMPLE(m_gpio_cfg[pin].init_high);
nrf_drv_gpiote_out_config_t cfg = GPIOTE_CONFIG_OUT_SIMPLE(nrf_gpio_pin_out_read(pin));
nrf_drv_gpiote_out_init(pin, &cfg);
}
m_gpio_initialized |= ((gpio_mask_t)1UL << pin);