Specifications
CAVR-4
Part 2. Compiler reference
Extended keywords
213
__task
Allows functions to exit without restoring registers. This keyword is typically used for
the
main function.
By default, functions save the contents of used non-scratch registers (permanent
registers) on the stack upon entry, and restore them at exit. Functions declared as
__task do not save any registers, and therefore require less stack space. Such functions
should only be called from assembler routines.
The function
main may be declared __task, unless it is explicitly called from the
application. In real-time applications with more than one task, the root function of each
task may be declared
__task.
The keyword is placed in front of the return type, for instance:
__task void my_handler(void);
The #pragma type_attribute directive can also be used. The following declaration
of my_handler is equivalent with the previous one:
#pragma type_attribute=__task
void my_handler(void);
The __task keyword must be specified both in the function declaration and when the
function is defined.
__tiny
Controls the storage of data objects in data memory space.
The
__tiny memory attribute overrides the default data storage of variables given by
the selected memory model.
__tinyflash
Controls the storage of data objects in flash (code) memory space.
The
__tinyflash memory attribute places objects in flash (code) memory.
Note that it is preferable to declare flash objects as constant.
Address range Max object size Pointer size Memory space
0-0xFF (256 bytes) 255 bytes 8 bits Data
Table 67: Tiny address ranges
Address range Max object size Pointer size Memory space
0-0xFF (256 bytes) 255 bytes 8 bits Code
Table 68: Tinyflash address ranges