I have gone through the email-example of cc3200. I want to implement the interrupt in non-os ,So I have modified the code but it does not work . It does not go in to interrupt. Did I miss anything in configuration
Here is my code.
#include <stddef.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <stdbool.h> #include <stdint.h> // simplelink includes #include "simplelink.h" // driverlib includes #include "hw_ints.h" #include "hw_types.h" #include "hw_memmap.h" #include "rom.h" #include "rom_map.h" #include "utils.h" #include "interrupt.h" #include "prcm.h" #include "timer.h" // common interface includes #include "network_if.h" #include "timer_if.h" #include "gpio_if.h" #include "button_if.h" #include "common.h" #ifndef NOTERM #include "uart_if.h" #endif #include "pinmux.h" #include "email.h" #include "demo_config.h" //**************************************************************************** // LOCAL DEFINES //**************************************************************************** #define APPLICATION_VERSION "1.1.1" #define APP_NAME "Switch Interrupt" //***************************************************************************** // GLOBAL VARIABLES -- Start //***************************************************************************** bool boolInterruptFlag=false; // GLOBAL VARIABLES for VECTOR TABLE #ifndef USE_TIRTOS /* in case of TI-RTOS don't include startup_*.c in app project */ #if defined(gcc) || defined(ccs) extern void (* const g_pfnVectors[])(void); #endif #if defined(ewarm) extern uVectorEntry __vector_table; #endif #endif //***************************************************************************** // GLOBAL VARIABLES -- End //***************************************************************************** //***************************************************************************** // //! \brief Interrupt Handler to Send Email upon Press of Push Button (S3) //! //! \param none //! //! \return void //! \note // //***************************************************************************** void SW2InterruptHandler() { Button_IF_EnableInterrupt(SW2); boolInterruptFlag=true; UART_PRINT("IN THE INTERRUPT HANDLER : SW2"); //Enable GPIO Interrupt } //***************************************************************************** //***************************************************************************** // //! \brief Interrupt Handler to Start Smart Config upon Press of Push Button (S2) //! //! \param none //! //! \return void //! \note //! \warning // //***************************************************************************** void SW3InterruptHandler() { Button_IF_EnableInterrupt(SW3); boolInterruptFlag=true; UART_PRINT("IN THE INTERRUPT HANDLER : SW3"); //Enable GPIO Interrupt } //***************************************************************************** //***************************************************************************** // //! Application startup display on UART //! //! \param none //! //! \return none //! //***************************************************************************** static void DisplayBanner(char * AppName) { UART_PRINT("\n\n\n\r"); UART_PRINT("\t\t *************************************************\n\r"); UART_PRINT("\t\t CC3200 %s Application \n\r", AppName); UART_PRINT("\t\t *************************************************\n\r"); UART_PRINT("\n\n\n\r"); } //***************************************************************************** // //! Board Initialization & Configuration //! //! \param None //! //! \return None // //***************************************************************************** static void BoardInit(void) { // // Set vector table base // #ifndef USE_TIRTOS // // Set vector table base // #if defined(ccs) || defined(gcc) MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]); #endif #if defined(ewarm) MAP_IntVTableBaseSet((unsigned long)&__vector_table); #endif #endif // // Enable Processor // MAP_IntMasterEnable(); MAP_IntEnable(FAULT_SYSTICK); PRCMCC3200MCUInit(); } //***************************************************************************** // //! Main function to start execution //! //! \param None //! //! \return None // //***************************************************************************** void main() { BoardInit(); PinMuxConfig(); GPIO_IF_LedConfigure(LED1|LED2|LED3); GPIO_IF_LedOff(MCU_ALL_LED_IND); #ifndef NOTERM // // Configuring UART // InitTerm(); #endif DisplayBanner(APP_NAME); //Initialize Push Botton Switch Button_IF_Init(SW3InterruptHandler,SW2InterruptHandler); while(1) { if(boolInterruptFlag) { UART_PRINT("Factory Reset"); } boolInterruptFlag=false; } } //******************************************************************************************************************************************
and I have made P4 and P15 as inputs for sw2 and sw3 the PinMuxConfig(); as
//***************************************************************************** void PinMuxConfig(void) { // // Enable Peripheral Clocks // MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK); MAP_PRCMPeripheralClkEnable(PRCM_GPIOA2, PRCM_RUN_MODE_CLK); MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK); // // Configure PIN_64 for GPIOOutput // MAP_PinTypeGPIO(PIN_64, PIN_MODE_0, false); MAP_GPIODirModeSet(GPIOA1_BASE, 0x2, GPIO_DIR_MODE_OUT); // // Configure PIN_01 for GPIOOutput // MAP_PinTypeGPIO(PIN_01, PIN_MODE_0, false); MAP_GPIODirModeSet(GPIOA1_BASE, 0x4, GPIO_DIR_MODE_OUT); // // Configure PIN_02 for GPIOOutput // MAP_PinTypeGPIO(PIN_02, PIN_MODE_0, false); MAP_GPIODirModeSet(GPIOA1_BASE, 0x8, GPIO_DIR_MODE_OUT); // // Configure PIN_04 for GPIOInput // MAP_PinTypeGPIO(PIN_04, PIN_MODE_0, false); MAP_GPIODirModeSet(GPIOA1_BASE, 0x20, GPIO_DIR_MODE_IN); // // Configure PIN_15 for GPIOInput // MAP_PinTypeGPIO(PIN_15, PIN_MODE_0, false); MAP_GPIODirModeSet(GPIOA2_BASE, 0x40, GPIO_DIR_MODE_IN); // // Configure PIN_55 for UART0 UART0_TX // MAP_PinTypeUART(PIN_55, PIN_MODE_3); // // Configure PIN_57 for UART0 UART0_RX // MAP_PinTypeUART(PIN_57, PIN_MODE_3); }
If anyone has done this before,please guide.
Thanks.