diff --git a/globals.h b/globals.h index 70828964..5b88dc05 100644 --- a/globals.h +++ b/globals.h @@ -147,7 +147,7 @@ struct statuses { unsigned int PW; //In uS volatile byte runSecs; //Counter of seconds since cranking commenced (overflows at 255 obviously) volatile byte secl; //Continous - volatile int loopsPerSecond; + volatile unsigned int loopsPerSecond; boolean launchingSoft; //True when in launch control soft limit mode boolean launchingHard; //True when in launch control hard limit mode int freeRAM; diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 68c5af46..e9a61b6d 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -1196,7 +1196,7 @@ menuDialog = main gaugeCategory = "Other" clockGauge = secl, "Clock", "Seconds", 0, 255, 10, 10, 245, 245, 0, 0 deadGauge = deadValue, "---", "", 0, 1, -1, -1, 2, 2, 0, 0 - loopGauge = loopsPerSecond,"Main loop speed", "Loops/S" , 0, 20000, -1, 500,1800, 4000, 0, 0 + loopGauge = loopsPerSecond,"Main loop speed", "Loops/S" , 0, 70000, -1, 500,1800, 4000, 0, 0 memoryGauge = freeRAM, "Free memory", "bytes" , 0, 8000, -1, 1000,8000, 1000, 0, 0 ;------------------------------------------------------------------------------- @@ -1363,7 +1363,7 @@ menuDialog = main TPSdot = scalar, U08, 21, "%/s", 10.00, 0.000 advance = scalar, U08, 22, "deg", 1.000, 0.000 tps = scalar, U08, 23, "%", 1.000, 0.000 - loopsPerSecond = scalar, S16, 24, "loops", 1.000, 0.000 + loopsPerSecond = scalar, U16, 24, "loops", 1.000, 0.000 freeRAM = scalar, S16, 26, "bytes", 1.000, 0.000 batCorrection = scalar, U08, 28, "%", 1.000, 0.000 spark = scalar, U08, 29, "bits", 1.000, 0.000 diff --git a/timers.h b/timers.h index 75a4c155..8b319f4c 100644 --- a/timers.h +++ b/timers.h @@ -24,7 +24,9 @@ volatile int loopSec; volatile unsigned long targetOverdwellTime; volatile unsigned long targetTachoPulseTime; - +#if defined (CORE_TEENSY) + IntervalTimer lowResTimer; +#endif void initialiseTimers(); #endif // TIMERS_H diff --git a/timers.ino b/timers.ino index 85461cb5..44d75aaf 100644 --- a/timers.ino +++ b/timers.ino @@ -26,6 +26,9 @@ void initialiseTimers() /* Now configure the prescaler to CPU clock divided by 128 = 125Khz */ TCCR2B |= (1<