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 meant, of course: "<place your id here>" !
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() ; } }
Thank you for your help, but how can I use this function? And how can I put a led toggle in this function?
Weak functions are optional. Add it to your code.
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)
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.
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.
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...
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.
View all questions in Keil forum