Function
#pragma NO_RETURN
None
None
None
This pragma suppresses the generation of the return instruction (return from subroutine or return from interrupt). Use this pragma when you care about the return instruction itself or when you want the code to fall through to the first instruction of the next function.
This pragma does not suppress the generation of the exit code (e.g., deallocation of local variables or compiler-generated local variables). The pragma suppresses the generation of the return instruction.
The following listing places some functions into a special named segment. An operating system calls each function two seconds after calling the previous function. Using this pragma, functions do not return, but fall directly through to the next function, saving code size and execution time.
#pragma CODE_SEG CallEvery2Secs #pragma NO_RETURN void Func0(void) { /* first function, called from OS */ ... } /* fall through!!!! */ #pragma NO_RETURN void Func1(void) { ... } /* fall through */ ... /* last function has to return, no pragma is used! */ void FuncLast(void) { ... }