프로그래밍6 Free RTOS (Timer) Example 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.. 2023. 7. 13. Free RTOS (Message Queue) Example Task간 동기화및 메시지 송수신을 위한 메시지 Queue 사용예입니다. TaskHandle_t myTask1Handle = NULL; TaskHandle_t myTask2Handle = NULL; QueueHandle_t myQueue; void myTask1(void *pvParameters) { TickType_t xDelay = pdMS_TO_TICKS(1000); TickType_t myLastUnblock; myLastUnblock = xTaskGetTickCount(); char myTxBuff[30]; myQueue = xQueueCreate( 5 , sizeof(myTxBuff) ); //size of queue (number of block), size of each block spri.. 2023. 7. 12. 이전 1 2 다음