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?
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