Skip to main content

Command Palette

Search for a command to run...

ISR_NAKED in Timer ISR

Updated
1 min read
R

I am a Software Engineer with experience in leveraging a variety of technologies to find the easiest and most efficient and effective way to meet the needs of the project's requirements. I like to build software and systems to help ease mundane and complex tasks.

ISR_NAKED tells the compiler, "Don't add your own register saving code"

ISR(TIMER1_COMPA_vect, ISR_NAKED)

This is critcal if you're using your own save/restore code because if the compiler adds its own prologue/epilogue on top of yours, registers will be double-saved and the stack will be wrong.

Here is a link to know what a prologue/epilogue is.