Tool/software: TI-RTOS
Hi E2E,
I've tried to setup a counter based interrupt in my BLE application, but the counter doesn't seem to start, ever.
The project is based on the simplePeripheral project, and the timer related code can be seen below:
/************************************************************************************************* Timer START **************************************************************************************************/ #include <ti/drivers/timer/GPTimerCC26XX.h> GPTimerCC26XX_Handle LEDTimer_handle; GPTimerCC26XX_Params timerParams; /************************************************************************************************* Timer END **************************************************************************************************/ void main() { /* Create timer for LED control */ GPTimerCC26XX_Params_init(&timerParams); timerParams.width = GPT_CONFIG_16BIT; timerParams.mode = GPT_MODE_PERIODIC_UP; //GPT_MODE_ONESHOT_UP; timerParams.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF; LEDTimer_handle = GPTimerCC26XX_open(CC2640R2_LAUNCHXL_GPTIMER3A, &timerParams); if(LEDTimer_handle != NULL){ PIN_setOutputValue(ledPinHandle, Board_PIN_LED0, !PIN_getOutputValue(Board_PIN_LED0)); } int matchValue = 48000000; // every sec GPTimerCC26XX_setMatchValue(LEDTimer_handle, matchValue); GPTimerCC26XX_setLoadValue(LEDTimer_handle, 0); GPTimerCC26XX_registerInterrupt(LEDTimer_handle, timerCallback, GPT_INT_MATCH); GPTimerCC26XX_start(LEDTimer_handle); } void timerCallback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) { PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, !PIN_getOutputValue(Board_PIN_LED1)); }
I can see from the LED, than the timer opens correct, and as try to debug the code, I can also see that the timer is started with the start-function. But, when I try to to call the "GPTimerCC26XX_getValue(LEDTimer_handle);" function over and over again, the counter seems to be stuck at 0.
Am I doing anything wrong?
Kind regards, Peter