MQX RTOS, Cortex M, task_create & task_destroy

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MQX RTOS, Cortex M, task_create & task_destroy

1,572件の閲覧回数
_ZZ_
Contributor II

Hi everybody,

it is me again. this one might be a bit odd. but here it is:

I want to create a task inside a interrupt service routine of a GPIO whenever the interrupt request is raised. then the created task will do what it should and at the end gets destroyed. the GPIO interrupt will be raised by rising edge. 

so: 

1. IGPIO RQ is raised 

2. _task_create(taskId) inside the GPIO isr

3 task runs and do something

4. _task_destroy(taskId) after it has done it its job

the points: 

>> is is possible to destroy a task inside itself

>> how to avoid creating the same task again when the 2nd IRQ is raised while the task is still doing something. 

basically I want to discard any irq until the task finishes its job and gets destroyed. 

I know I can use event to block and those kind of things but want to do it specifically by creating and destroying in periodically. 

I thought maybe disable the GPIO irq right after creating the task and enable it when the task is done its job. is there a better way? 

0 件の賞賛
返信
1 返信

1,379件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi Roosbeh:

In my opinion, it is not good to call _task_create in an ISR. I would suggest you signalling a task in an ISR.

Regards

Daniel

0 件の賞賛
返信