You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMSIS-RTOS2 priorities available to user (Low, BelowNormal, Normal, AboveNormal, High, Realtime) are extended with a 3-bit sub priority and CMSIS-RTOS2 implementation can support flexible number of sub priorities (1, 2, 4 or 8).
Is it possible to implement reduced number of priorities for CMSIS-FreeRTOS port? I think it is a simple bit shift operation in few parts of the code.
Currently configMAX_PRIORITIES must be set to 56. Each priority needs a slot in RAM memory. For 56 priorities it causes high memory consumption. Maybe configMAX_PRIORITIES can be configurable?
configMAX_PRIORITIES 56 support all 8 sub priorities => shift = 0
configMAX_PRIORITIES 28 support 4 sub priorities (ex. Low..Low+1 are effectively the same) => shift = 1
configMAX_PRIORITIES 14 support 2 sub priorities (ex. Low..Low+3 are effectively the same) => shift = 2
configMAX_PRIORITIES 7 support 1 sub priority (ex. Low..Low+8 are effectively the same) => shift = 3
In the simplest form osPriority numbering can be scaled down (ex. for 1 sub priority => shift = 3):
CMSIS-RTOS2 priorities available to user (Low, BelowNormal, Normal, AboveNormal, High, Realtime) are extended with a 3-bit sub priority and CMSIS-RTOS2 implementation can support flexible number of sub priorities (1, 2, 4 or 8).
Is it possible to implement reduced number of priorities for CMSIS-FreeRTOS port? I think it is a simple bit shift operation in few parts of the code.
Currently
configMAX_PRIORITIES
must be set to 56. Each priority needs a slot in RAM memory. For 56 priorities it causes high memory consumption. Maybe configMAX_PRIORITIES can be configurable?configMAX_PRIORITIES 56 support all 8 sub priorities => shift = 0
configMAX_PRIORITIES 28 support 4 sub priorities (ex. Low..Low+1 are effectively the same) => shift = 1
configMAX_PRIORITIES 14 support 2 sub priorities (ex. Low..Low+3 are effectively the same) => shift = 2
configMAX_PRIORITIES 7 support 1 sub priority (ex. Low..Low+8 are effectively the same) => shift = 3
In the simplest form osPriority numbering can be scaled down (ex. for 1 sub priority => shift = 3):
The text was updated successfully, but these errors were encountered: