I want to create Hwi, and toggle LED by button SW3 switch, in Hwi context. But the interrupt from SW3 is not responding, no blinking LED.
Know anyone where the error is and has someone an example that works?
Enable interrupt or interrupt “pin number” might be the problem.
If I use callbacks, everything works (for example I adapt gpiointerrupt_CC3200).
I use following code:
My function:
////////////////////////
void gpioHWIFxn3(void)
{
GPIO_toggle(Board_LED1); // LED D6 yellow
}
Code should be executed in HWI CONTEXT
So I enabled Hwi MODULE in cfg file
instance -> add -> hwi0
that calls gpioHWIFxn3() function, interrupt number 17 (SW3, GPIO PortA1? )
MaskingOption_?
//////////////////////////
My main(),
adapt gpiointerrupt_CC3200 from “Project examples – Wireless Connectivity MCU – Driver Examples – GPIO _ Interrupt”
When I use callbacks, everything works correctly, that means pinmux is ok.
int main(void)
{
/* Call board init functions */
Board_initGeneral();
Board_initGPIO();
Board_initUART();
/* Turn on user LED */
GPIO_write(Board_LED0, Board_LED_ON);
System_printf("Starting the GPIO Interrupt example\nSystem provider is set"
" to SysMin. Halt the target to view any SysMin contents in"
" ROV.\n");
/* SysMin will only print to the console when you call flush or exit */
System_flush();
/* install Button callback */
GPIO_setCallback(Board_BUTTON2, gpioButtonFxn0); //SW2, LED red
/* Enable interrupts */
GPIO_enableInt(Board_BUTTON2);
/*
* If more than one input pin is available for your device, interrupts
* will be enabled on Board_BUTTON1.
*/
// if (Board_BUTTON0 != Board_BUTTON1) {
/* install Button callback */
// GPIO_setCallback(Board_BUTTON3, gpioButtonFxn1);
// GPIO_enableInt(Board_BUTTON3);
// }
/* Start BIOS */
BIOS_start();
return (0);
}
In other forums, I found the same problem but never a complete solution.
Anyone have a simple working example for me?
See my problem thank you for that.