I am running the SDK GPIO demo on a TRW-K21F120M and the LED does not toggle when the switch is pressed.
Looking at the source code I see that an ISR is defined for the switches, but there isn't any code to install it. Probably why it isn't working.
Is this a bug or am I missing something.
Thanks,
Randy
Solved! Go to Solution.
Hello Randy,
Did you run the project located in C:\Freescale\KSDK_1.2.0\examples\twrk21f120m\driver_examples\gpio\kds?
I ran that project and it works OK. The macro BOARD_SW_IRQ_HANDLER is to call the interrupt handler for the port C PORTC_IRQHandler. This handler is called in every falling edge if the SW2 (PTC7). It is configured in the structure gpio_input_pin_user_config_t inputPin in the field .config.interrupt. Please debug the project and be sure if the interrupt handler BOARD_SW_IRQ_HANDLER is called after you press the SW2.
Best regards,
Earl.
Hello Randy,
Did you run the project located in C:\Freescale\KSDK_1.2.0\examples\twrk21f120m\driver_examples\gpio\kds?
I ran that project and it works OK. The macro BOARD_SW_IRQ_HANDLER is to call the interrupt handler for the port C PORTC_IRQHandler. This handler is called in every falling edge if the SW2 (PTC7). It is configured in the structure gpio_input_pin_user_config_t inputPin in the field .config.interrupt. Please debug the project and be sure if the interrupt handler BOARD_SW_IRQ_HANDLER is called after you press the SW2.
Best regards,
Earl.
Thank you Earl,
I rebuilt and it works. Not sure what I did wrong the 1st time.
Randy