Robert Seczkowski wrote:
Does anyone knows solution for nice function call within interrupt. For now I am trying to avoid it, because as You may know the ISR don't reserve upper registers for potential function use ( r12-r15).

that depends if you speak of an assembler implementation or C. what you say is not correct fo C.

C: the "interrupt" keyword advises the C compiler to save r12 to r15. you can safely call other functions.

assembler: just wrap manually all calls to C functions with 4 push/pop insn: push r15 .. push r12, call, pop r12 .. pop r15

It would be nice feature to pass through ie. r15 any parameters to ISR

you can advise the C compiler to not use some registers. e.g. you can reserve R5 and R6. in that case, an interrupt function does not need to save them. you have to manualy track the register usage of these two, if you have more than one interrupt using them. however, you decrease the code efficiency of the compiler if you take registers away.

chris

Reply via email to