Discussion Forum

can you use os_create_task() in an interrupt?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Eddie Weigle
Posted
27-Aug-2007 18:33 GMT
Toolset
C51
New! can you use os_create_task() in an interrupt?

Is it possible to use os_create_task() from rtx tiny from within an ISR? Can it corrupt the stack?

Read-Only
Author
Reinhard Keil
Posted
28-Aug-2007 09:39 GMT
Toolset
C51
New! RE: can you use os_create_task() in an interrupt?

No you cannot use functions that start with os_ within interrupt routines. You must use functions that start with isr_ from interrupts.

Therefore it is not possible to create a task within an interrupt service routine.

Read-Only
Author
gordon dey
Posted
20-Sep-2007 22:16 GMT
Toolset
C51
New! RE: can you use os_create_task() in an interrupt?

To guarantee a task is created, use os_create_task() from task 0's initialization code, i.e. before it does any work. The created task can then be then run, but arrange for the created task to block with os_wait1(). Later on, at the end of initialization, turn on the interrupts. An isr_send_signal() within the ISR handler then wakes it up, and you get the effect I think you want.

Next Thread | Thread List | Previous Thread Start a Thread | Settings