GPIO demo not working

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

GPIO demo not working

ソリューションへジャンプ
1,231件の閲覧回数
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,067件の閲覧回数
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,068件の閲覧回数
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,067件の閲覧回数
randyhermes
Contributor III

Thank you Earl,

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

Randy

0 件の賞賛
返信