Interrupt AVR

David Obdrzalek David.Obdrzalek na mff.cuni.cz
Pátek Duben 11 14:49:49 CEST 2014


Podival jsem se do obou a zarazilo me:

On 11 Apr 2014 at 8:31, Pavel Brychta wrote:
> http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

ISR is created with no prologue or epilogue code. The user code is responsible 
for preservation of the machine state including the SREG register, as well as 
placing a reti() at the end of the interrupt routine.


On 11 Apr 2014 at 8:33, Jan Waclawek wrote:
> http://nongnu.org/avr-libc/user-manual/group__avr__interrupts.html#ga8b4c7e446
> 27db0a60d676213add42d64

Use this attribute on the ARM, AVR, MCORE, MSP430, NDS32, RL78, RX and SPU 
ports to indicate that the specified function does not need prologue/epilogue 
sequences generated by the compiler. It is up to the programmer to provide 
these sequences. The only statements that can be safely included in naked 
functions are asm statements that do not have operands. All other statements, 
including declarations of local variables, if statements, and so forth, should 
be avoided. Naked functions should be used to implement the body of an assembly 
function, while allowing the compiler to construct the requisite function 
declaration for the assembler. 


Jak je to teda v avr-libc v pripade pouziti naked s lokalnimi promennymi? 
Doslova vzato, oni rikaji, ze tam nebude zadny prolog/epilog, takze ani alokace 
a inicializace lokalnich promennych? I kdyz ono to vlastne dava smysl, protoze 
kdyz uz bych psal naked, tak to znamena, ze fakt chci presne sam urcit, co se 
tam bude delat a v takovem pripade je prirozene, ze se i sam postaram o lokalni 
promenne.

D.O.



Další informace o konferenci Hw-list