Click here to remove the style sheet (in order to print it or if you encounter problems).
Develop an application composed by two tasks with the following execution order :
You will use semaphores. Try to modify the relative priorities of the two tasks: the execution must not be modified.
Exercise 2Let us consider a "watch dog" task which check that a counter is incremented regularly. In case of error, it has the following behavior :
- if the counter has not been incremented after 150ms, an error message is produced (watchdog functionality).
- if the execution of the watch dog is not completed after 100ms, an error message is produced (deadline missed detection).
Write the code for a task which simulate the counter access (using a semaphore) and which will slow down regularly to switch from 50ms to 200ms in order to test the first kind of error.
Write the watch dog task. In order to be able to test the second error type, you will add a treatment loop, either in the watch dog task or in an other task with an higher priority.