As others already suggested, you can consider several other approaches -
- Place more restrictions on what priorities user tasks can have.
- Place a restriction that no user task can have maximum priority (i.e. configMAX_PRIORITIES - 1) and then create one task with max priority in the framework which can be used for priority re-assignments. If you are using FreeRTOS timers, you can create the timer task at the highest priority and use
configUSE_DAEMON_TASK_STARTUP_HOOKfor priority re-assignments - Hook Functions - FreeRTOS™.
This is taken care in the vTaskSwitchContext.