View Single Post
Old 10-28-14, 09:41 AM   #271
theoldwizard1
Apprentice EcoRenovator
 
Join Date: Oct 2014
Location: SE MI
Posts: 105
Thanks: 3
Thanked 12 Times in 9 Posts
Default

Quote:
Originally Posted by buffalobillpatrick View Post
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 ..."

theoldwizard1 is offline   Reply With Quote
The Following User Says Thank You to theoldwizard1 For This Useful Post:
buffalobillpatrick (10-29-14)