reti in vector table?

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have three ISRs which do nothing, but, as far as I know, they need to be there, as the repective interrupts are all used as sleep wake ups.
Left to its own devices, GCC will add the code to save and restore registers/status, which is fine.
If I add the NAKED attribute, and manually add the reti(), then I get a big saving on code space, but is there a convenient(without resorting to assembler) way to place the reti() in the vector table, as this would save another couple of bytes per ISR?

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EMPTY_INTERRUPT () ;-)

Though I'm not sure it actually goes as far as just placing a RETI.

I think you might need to provide your own .vectors probably with a .S file to actually get RETI at the vector location.

Last Edited: Wed. Jan 16, 2013 - 09:23 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just found that myself. It's better than NAKED, in that it adds the reti(), but it still generates two unnecessary bytes of code, as the reti would surely fit in the vector table.

Four legs good, two legs bad, three legs stable.

Last Edited: Wed. Jan 16, 2013 - 09:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just also found the ALIAS_OF macro, saving a few more bytes...

So 3 ISRs now only take up 2 bytes. That's good enough for me, I can live with that.

John

Four legs good, two legs bad, three legs stable.