Prusa MINI Firmware overview
uxTaskGetNumberOfTasks

task. h

uint16_t uxTaskGetNumberOfTasks( void );
Returns
The number of tasks that the real time kernel is currently managing. This includes all ready, blocked and suspended tasks. A task that has been deleted but not yet freed by the idle task will also be included in the count.