286 EMBEDDED SYSTEMS
}
}
void error_task (void)
{
for(;;)
{
/* wait for I/O error signal */
semaphore_wait(&sem_error)
/* send a beep to the speakers to indicate
error */
Beep_Speaker();
}
}
Some points to remember when using an RTOS
We have seen that an RTOS is very helpful when dealing with timing related code.
However, an RTOS does have some disadvantages:
i) Requires more memory: since each task requires its own stack, stack space can get
eaten up quickly as the number of tasks increase. Since the binary image also has the
RTOS code, more ROM will be needed.
ii) Overhead: the Kernel is also a code that needs to execute: this adds some overhead
to application code execution. Typically, (2–5%) of execution time is used up by the
kernel itself. ...