Part Number: EK-TM4C129EXL
Tool/software: TI-RTOS
I am working with timer module. I configured the timer using XGCONF. ISR Function is to toggle the state of LED for every 1 second. LED tends to glow continuously instead of blinking for 1 second. I couldn't able to find the problem in the code.
/* * ======== empty_min.c ======== */ /* XDCtools Header files */ //---------------------------------------- // BIOS header files //---------------------------------------- #include <xdc/std.h> #include <ti/sysbios/BIOS.h> #include <xdc/runtime/Log.h> #include <xdc/cfg/global.h> //------------------------------------------ // TivaWare Header Files //------------------------------------------ #include <stdint.h> #include <stdbool.h> #include "inc/hw_types.h" #include "inc/hw_memmap.h" #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include "inc/hw_ints.h" #include "driverlib/interrupt.h" #include "driverlib/timer.h" /* BIOS Header files */ #include <ti/sysbios/BIOS.h> #include <ti/sysbios/knl/Task.h> /* TI-RTOS Header files */ #include <ti/drivers/GPIO.h> /* Board Header file */ #include "Board.h" #define TASKSTACKSIZE 128 Task_Struct task0Struct; Char task0Stack[TASKSTACKSIZE]; void Timer_ISR(void);
/* * ======== heartBeatFxn ======== * Toggle the Board_LED0. The Task_sleep is determined by arg0 which * is configured for the heartBeat Task instance. */ Void heartBeatFxn() // This is ISR function { GPIO_toggle(Board_LED0); } /* * ======== main ======== */ int main(void) { Task_Params taskParams; /* Call board init functions */
Board_initGeneral(); Board_initGPIO(); /* Construct heartBeat Task thread */ Task_Params_init(&taskParams); taskParams.stackSize = TASKSTACKSIZE; taskParams.stack = &task0Stack; Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL); /* Turn on user LED */ GPIO_write(Board_LED0, Board_LED_ON); /* Start BIOS */ BIOS_start(); return (0); }