Quote:
Originally Posted by buffalobillpatrick
Whew! took hours, lots of stuff don't work in a ISR (Interrupt Service Routine)
delay(x) , lcd.print, &
biggest pain was
Compiler was optimizing out various "delay for loops" that I tried, ...
|
Write a "generic" delay called function. Compile it as a separate file with the optimizer turned off
(-O0 on gcc, IIRC). Link it in.
When messing with ISR, make sure you understand any limitation the original author design in, like possible not saving all registers. Also be careful on how many nested function you call so that you don't overflow the stack.
Many years ago, in a "former life ..."