GPIO demo not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO demo not working

Jump to solution
529 Views
randyhermes
Contributor III

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

Labels (1)
1 Solution
365 Views
EarlOrlando
Senior Contributor II

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.

View solution in original post

2 Replies
366 Views
EarlOrlando
Senior Contributor II

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.

365 Views
randyhermes
Contributor III

Thank you Earl,

I rebuilt and it works.  Not sure what I did wrong the 1st time.

Randy

0 Kudos