mbed library sources
Fork of mbed-src by
Diff: targets/hal/TARGET_Freescale/TARGET_KLXX/TARGET_KL46Z/gpio_irq_api.c
- Revision:
- 86:26fc69fd3b6c
- Parent:
- 82:0b31dbcd4769
- Child:
- 113:65a335a675de
--- a/targets/hal/TARGET_Freescale/TARGET_KLXX/TARGET_KL46Z/gpio_irq_api.c Fri Feb 07 18:00:11 2014 +0000 +++ b/targets/hal/TARGET_Freescale/TARGET_KLXX/TARGET_KL46Z/gpio_irq_api.c Sat Feb 08 12:00:07 2014 +0000 @@ -37,8 +37,9 @@ if (port->ISFR & pmask) { mask |= pmask; uint32_t id = channel_ids[ch_base + i]; - if (id == 0) + if (id == 0) { continue; + } FGPIO_Type *gpio; gpio_irq_event event = IRQ_NONE; @@ -181,3 +182,13 @@ NVIC_DisableIRQ(PORTC_PORTD_IRQn); } } + +// Change the NMI pin to an input. This allows NMI pin to +// be used as a low power mode wakeup. The application will +// need to change the pin back to NMI_b or wakeup only occurs once! +extern void gpio_init(gpio_t *obj, PinName pin, PinDirection direction); +void NMI_Handler(void) +{ + gpio_t gpio; + gpio_init(&gpio, PTA4, PIN_INPUT); +}