Hi,
I am using a "fast irq" for comm and inserting data into a lock-free queue as it comes in. So far so good...
I would like to signal a sleeping thread that there is data available, from inside the "fast irq". I know of two ways: (1) having the thread busy-waiting checking on the queue, or (2) trigger a regular EXTI irq from the "fast irq" and have the handler wake up the thread. Is there another way?
~T
Waking up a thread from a fast irq?
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Waking up a thread from a fast irq?
Hi,
The recommended way is to trigger a normal IRQ to wake up the thread. This can be done using EXTI but there is a dedicated Cortex-M interrupt for that: "PendSVVector". Note that this vector is not available in the simplified kernel mode (the option CORTEX_SIMPLIFIED_PRIORITY which is not the default anyway).
Giovanni
The recommended way is to trigger a normal IRQ to wake up the thread. This can be done using EXTI but there is a dedicated Cortex-M interrupt for that: "PendSVVector". Note that this vector is not available in the simplified kernel mode (the option CORTEX_SIMPLIFIED_PRIORITY which is not the default anyway).
Giovanni
Re: Waking up a thread from a fast irq?
Awesome! That's the kind of solution I was hoping for. Thanks a lot,
~t
~t