GPIO demo not working

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

GPIO demo not working

跳至解决方案
1,229 次查看
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

标签 (1)
1 解答
1,065 次查看
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.

在原帖中查看解决方案

2 回复数
1,066 次查看
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.

1,065 次查看
randyhermes
Contributor III

Thank you Earl,

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

Randy

0 项奖励
回复