Paul,
Is the code not working because you don't reenable the interrupts after copying the variables?
The code would be easier to read with nicer variable names. I suggest globalISRcurrent, temp and throttle. globalADCMode, and globalISRcounter. I think everything else can be a local variables. throttle, current and temperature, currentSum, etc. Eliminating tmp and _ variables.
David
|