We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
There are two tasks task 0 and task 1 and one timer_interrupt_ISR.
f_0 _task_ 0 { .. .. .. switch_2_lp_func(); .. .. .. switch_2_lp_func(); } switch_2_lp_func() { starts the timer; os_create_task(1); os_switch_task(); .. .. } lp_func _task_ 1 { while(1) { ... } } timer_interrupt ISR { os_set_ready(0); os_delete_task(1); os_switch_task(); }
What happens when a task is deleted in ISR? 1) Is it possible that ISR will retrun to PC address on the stack or take into account of deleted task from the task list. 2) Does os_delete_task(1) delete the stack space of task 1 ?
The os_ functions should not be called from an ISR. Take a look at the notes on the bottom of http://www.keil.com/support/man/docs/tr51/tr51_libref.htm
Jon
Thanks for the pointer.
I still have this question pending.
What happens to the stack of the task that is deleted from the task list using os_delete_task(task num) function ?