How do I implement an interrupt service routine (ISR) in FreeRTOS?
@Middleware & OS
Hello guys, how do I Implement an interrupt service routine (ISR) in FreeRTOS that triggers a task when a button is pressed and also Ensure the ISR communicates with the task using a binary semaphore
Solution:Jump to solution
You can achieve this with the following steps
1. Configure the button press as an interrupt source.
2. Write the ISR to give a binary semaphore when the button is pressed.
3. Create a task that takes the semaphore and runs when the semaphore is given....
6 Replies
@Enthernet Code start your setup by configuring the button pin to trigger an interrupt
on press
. Then create your binary semaphore using .So now when the button is pressed, your ISR will now briefly signals the semaphore with
The task waits on the semaphore with
Now we press the button
semaphore
is signaled, the task wakes up and does somethingThe priority you must put on ISR should be higher than the task tho
Solution
You can achieve this with the following steps
1. Configure the button press as an interrupt source.
2. Write the ISR to give a binary semaphore when the button is pressed.
3. Create a task that takes the semaphore and runs when the semaphore is given.
Thanks would do this