Hallo,
ich versuche am curiosity Pro mit dem PIC32MK den pin change interrupt
zu implementieren. Dazu gibt es auch einige Beispiele von mc bei GitHub.
Aber es läuft nicht. Die Interruptroutine wird nicht angesprungen. Die
Pineinstellung von Interrupt erfolgt über Harmony 3 und wird dann im
Programm wie folgt aufgerufen.
1 | void controlLED(GPIO_PIN pin, uintptr_t context)
|
2 | {
|
3 | if(SWITCH_Get() == 1)
|
4 | {
|
5 | /* Turn ON LED */
|
6 | LED_Set();
|
7 | }
|
8 | else
|
9 | {
|
10 | /* Turn OFF LED */
|
11 | LED_Clear();
|
12 |
|
13 | }
|
14 | }
|
15 |
|
16 | int main ( void )
|
17 | {
|
18 | /* Initialize all modules */
|
19 | SYS_Initialize ( NULL );
|
20 |
|
21 | GPIO_PinInterruptCallbackRegister(SWITCH_PIN, controlLED, (uintptr_t)NULL);
|
22 | GPIO_PinInterruptEnable(SWITCH_PIN);
|
23 |
|
24 | while ( true )
|
25 | {
|
26 | /* Maintain state machines of all polled MPLAB Harmony modules. */
|
27 | SYS_Tasks ( );
|
28 |
|
29 | }
|
30 |
|
31 | /* Execution should not come here during normal operation */
|
32 |
|
33 | return ( EXIT_FAILURE );
|
34 | }
|
Kennt sich einer hier aus?