One of the first things any literature says about using interrupts is 'keep the code small'. I was wondering if there are rules of thumb regarding how much is too much to fit inside a callback function, and what to do when it is indeed too much.
My code has a callback function using the hardware timer that needs several if statements, writes to a digital pin, flips a boolean, and calculates a value after reading a value from a table in program memory. All of these separate items are timing-critical, and won't work outside of the callback function (I've checked).
at present, the code works. However, I'm about to add a lot more code and know that I'll have to deal with this sooner or later.
Can anyone recommend a method for handling timing-critical functions that are/may be too large to fit inside of one callback function?
Thanks in advance.