mirror of https://github.com/ARMmbed/mbed-os.git
Fixed broken InterruptIn.mode() in NRF5x target which didn't do anything: interruptIn always remained with pullup resistor enabled.
parent
4a5e6a9d7d
commit
f59655629e
|
@ -129,16 +129,6 @@ static void gpio_apply_config(uint8_t pin)
|
|||
cfg.hi_accuracy = false;
|
||||
cfg.is_watcher = false;
|
||||
cfg.sense = NRF_GPIOTE_POLARITY_TOGGLE;
|
||||
if (m_gpio_cfg[pin].used_as_irq) {
|
||||
cfg.pull = NRF_GPIO_PIN_PULLUP;
|
||||
nrf_drv_gpiote_in_init(pin, &cfg, gpiote_irq_handler);
|
||||
if ((m_gpio_irq_enabled & ((gpio_mask_t)1 << pin))
|
||||
&& (m_gpio_cfg[pin].irq_rise || m_gpio_cfg[pin].irq_fall))
|
||||
{
|
||||
nrf_drv_gpiote_in_event_enable(pin, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch(m_gpio_cfg[pin].pull) {
|
||||
case PullUp:
|
||||
cfg.pull = NRF_GPIO_PIN_PULLUP;
|
||||
|
@ -150,6 +140,15 @@ static void gpio_apply_config(uint8_t pin)
|
|||
cfg.pull = NRF_GPIO_PIN_NOPULL;
|
||||
break;
|
||||
}
|
||||
if (m_gpio_cfg[pin].used_as_irq) {
|
||||
nrf_drv_gpiote_in_init(pin, &cfg, gpiote_irq_handler);
|
||||
if ((m_gpio_irq_enabled & ((gpio_mask_t)1 << pin))
|
||||
&& (m_gpio_cfg[pin].irq_rise || m_gpio_cfg[pin].irq_fall))
|
||||
{
|
||||
nrf_drv_gpiote_in_event_enable(pin, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
nrf_gpio_cfg_input(pin,cfg.pull);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue