I am debugging some source code with Keil uv3 IDE. We are using ARTX for ARM. My question is how can I find out the number of tasks managed by the RTOS? Thanks
Jian, I don't use the Arm compiler, so what follows is unlikely to work for you, however here we go: - the debugger can tell you right away how many tasks are running, plus much more information. It should be part of the "peripherals" menu. - if you want your own program to know how many tasks are running, a good place to start looking is os_active_TCB[]. I imagine that a piece of code like:
#include "blah...\AR166\SRC\Kernel\AR166_Config.h" #include "blah...\AR166\SRC\Kernel\AR_C_Interface.h" unsigned int NumberOfRunningTasks = 0; for (i=os_maxtaskrun; i--;) { if (os_active_TCB[i]!=PNULL) { NumberOfRunningTasks++; } }