본문 바로가기
프로그래밍/STM32

Free RTOS (Timer) Example

by C.D.콤파스 2023. 7. 13.

Free RTOS의 TIMER를 사용하는 방법입니다.

 

#define configUSE_TIMERS                         1 // Required

#define configTIMER_TASK_PRIORITY                6

#define configTIMER_QUEUE_LENGTH                 10

#define configTIMER_TASK_STACK_DEPTH             configMINIMAL_STACK_SIZE


osTimerId  TimerHandle;

void TimerHandler(void const * arg)
{
    printf("TimerHandler\r\n");
}


osTimerDef(TS_Timer, TimerHandler);
TimerHandle = osTimerCreate(osTimer(TS_Timer), osTimerPeriodic, NULL);
status = osTimerStart(TimerHandle, 100);