Hello,
In order to know if my program is correctly running, I need to know how many time is spent in the idle task of my RTX OS (OS integrated with Keil) in order to be sure that my microcontrller has enougth time to execute all tasks. Thank you for your help
Ludovic
PS: I work on a cortex M3 microcontroller
I'd use a scope - that way you'll be a 100% sure. If you don't have one use a RAM buffer recording the value of a hardware timer.
Yes of course I can use a scope but the problem is that I know when my program goes in the idle task (I can put a led on for example) but I don't know when it leaves the task, so I cannot put a led off...
Use this RTX weak function:
void rt_post_taskswitch(unsigned int a_task_id)
If available, it is called upon task switch with parameter value indicating the next task id.
You can also unlit the LED for any other task, leaving only the idle task to lit it. That cannot be a bad approximation, too.
This function seems to be not available for me because I don't have the RTX sources files. The aim of my test is to be sure that the microcontrller is not overloaded by my program (a lot of signal processing)
Weak functions are optional. Add it to your code.
Thank you for your help, but how can I use this function? And how can I put a led toggle in this function?
void rt_post_taskswitch(unsigned int a_task_id) { // idle task? if (a_task_id == <place you're id here>) { lit_LED() ; } else { unlid_LED() ; } }
I meant, of course: "<place your id here>" !