FreeRTOS study notes 4: Time Management

 

Absolute Time: abs Time
Relative Time: Percentage% time

IDLE is idle task.

 

RUN_Time_State:
Port. . . () Initializes a timing unit providing peripheral // initializes to their specific operation
of this timer is the system clock resolution higher than freeRTOS, 10-20 1s = 1000ms = 1000000us 1khz system clock needs to 10k ~ 20khz or

Further two macros (a can) to achieve statistical time, acquisition time of the value of the time base unit.

 

Delay function vTaskDelay () // relative. Also you need to configure the macros

Absolute mode can be periodic task
steps of:
determination of mass participation> 0
2 vTaskSuspendAll () // mobilization is pending tasks. Will resume later

3 The current task is added to the delay list. // There is a list of all the delays recorded tasks
// two parameters: To delay the time, pdFALSE

4 Recovery: Record xTaskResumeAll () whether there task switching
if xTaskResumeAll () == pdFALSE // the return value is restored in the task scheduler does not switch
5 require a task switch
the task switching reasons: there is removed from the task ready state in addition, the delay added to the list, the state changes
the state changes need to check there is no change in mission requirements


3 is added to delay the current task to the list:
Get current system clock tick: xTickCount

list remove tasks uxListRemove (parameter passing task control block in the state list)


The time:

 

Timer tick, tick timer tasks.c
task switching and other administrative tasks, systick periodically triggers an interrupt,

Four registers:
the CTRL control and status register OxE00E010
LOAD auto-reload register value
VAL current count value register
CALIB Calibration Value Register

 

Guess you like

Origin www.cnblogs.com/yyyyloveu/p/12333030.html