AnsweredAssumed Answered

Problem With Virtual Timer

Question asked by vanima.nooshin on Feb 9, 2015
Latest reply on Feb 10, 2015 by Giovanni Di Sirio

I Want to use a virtual timer in my program , i think the code is ok but when i debug it the program all is in this function : static void tmrfunc(void *p)
please see the code and say to me what wrong in my program .

#include "components.h"

static virtual_timer_t tmr;

uint8_t Timer_Flag= 0;

 * @brief   Timer callback function.
 * @param[in] p         NULL
 * @notapi
static void tmrfunc(void *p)

  vtSetI(&tmr, OSAL_MS2ST(500), tmrfunc, NULL);

  Timer_Flag= 1;

 * Application entry point.
int main(void)

  /* Initialization of all the imported components in the order specified in
     the application wizard. The function is generated automatically.*/


  /* Interrupts are enabled and the system is ready.*/

     vtSet(&tmr, OSAL_MS2ST(500), tmrfunc, NULL);

  while (1)

       if (Timer_Flag== 1)
            palTogglePad(PORT_C, PC_LED7);