SPNU151V January 1998 – February 2020
The TASK pragma specifies that the function to which it is applied is a task. Tasks are functions that are called but never return. Typically, they consist of an infinite loop that simply dispatches other activities. Because they never return, there is no need to save (and therefore restore) registers that would otherwise be saved and restored. This can save RAM space, as well as some code space.
The syntax of the pragma in C is:
#pragma TASK(func) |
The syntax of the pragma in C++ is:
#pragma TASK |