Part Number: MSP430FR2422
Presently gcc allows one to attribute a function as interrupt.
I would like to see an additional modifier tag with the following specification, when added as an attribute:
-Must accompany an "interrupt" tag
-Instead of using the normal RETI to return, use RET
My motivation for this request is to reduce the number of clock cycles spent with interrupts disabled.
When I write an interrupt handler, I access the sensitive bits (such as TA0CCR1) then quickly re-enable interrupts to allow other time sensitive processes to continue.
Then I do whatever needs to be done and RETI from the function.
However, presently if I have an interrupt function, all registers touched in the function are pushed on the stack before I can even access a time sensitive register (such as TA0CCR1)
What I would like to do is split my interrupt handler into 2 functions:
-an immediate handler (that pushes very few or no registers on the stack) that handles the time sensitive stuff and re-enables interrupts
-a followup function (tagged with the "interrupt" and the new attribute) called by the immediate handler (with CALL) that then pushes whatever registers are needed on the stack and returns with RET
I have hacked similar behaviours like this before using asm "br ADDR" instructions, but I think this way would be cleaner.
In the same vein, I would expect that if an interrupt function pushes no arguments on the stack and calls another interrupt function, this would simplify to just a "br" instruction.