Atmel CAVR-4 Manuale Utente

Pagina di 323
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