Tool/software: TI-RTOS
Hi greetings! I tried the following code and made it work (no more crashes). However, it seems that the callback function TimerISR() was never called. Which part am I missing? Any hints? Thanks in advance.
//Timer ISR void TimerISR(UArg a0) { //clear interrupt flag TimerIntClear(GPT1_BASE, TIMER_TIMB_TIMEOUT); // Allow STANDBY mode again //Power_releaseConstraint(Power_SB_DISALLOW); } //timer init function void TimerInit(uint32_t usec) { PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH); PRCMLoadSet(); PRCMPeripheralRunEnable(PRCM_PERIPH_TIMER1); PRCMLoadSet(); Hwi_Params hwiParams; Hwi_Params_init(&hwiParams); hwiParams.enableInt = true; //construct an HWI Hwi_construct(&hwi, INT_TIMER1B, TimerISR, &hwiParams, NULL); unsigned long TIMER_LOADSET = 48 * usec - 1; // Disallow STANDBY mode while using the timer. Power_setConstraint(Power_SB_DISALLOW); // set Timer-A as periodic count mode TimerConfigure(GPT1_BASE, TIMER_CFG_B_PERIODIC); // set the load value of timer TimerLoadSet(GPT1_BASE, TIMER_B, TIMER_LOADSET); // Enable interrupt TimerIntEnable(GPT1_BASE, TIMER_TIMB_TIMEOUT); // Enable timer TimerEnable(GPT1_BASE, TIMER_B); }