Those sound like good variable names. I did global for everything at first because I wasn't sure what I wanted to be local, and I didn't want to re-initialize variables each time. It's a practice that old school 3d video game programmers, a la Andree Lamothe, did in the late 80's & early 90s.
I believe the interrupts are re-enabled by resetting the SREG register to what it was before disabling interrupts, rather than using sti(). It works in the simulator, as far as I can tell, but in the car, even the high pedal lockout isn't working! I think there is a fundamental problem with the old hardware from the blown up control section. Voltage spikes are now much worse in the control section than when I first tested it on the first controller that blew up. I really don't think the software is all to blame. I can't really do much until I get a new oscilloscope, which will be very soon, either by a friend that's checking on some for me, or by getting another on Ebay.
|