File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ void Devlpr::tick()
2020 // accrue micros on the micros since last run
2121 microsSinceEMG += microsDelta;
2222 // check if enough time has passed to read EMG
23- if (microsSinceEMG > MICROS_SCHED_EMG) {
23+ if (microsSinceEMG >= MICROS_SCHED_EMG) {
2424 readEMG ();
2525 // and update micros since
26- microsSinceEMG = 0 ;
26+ microsSinceEMG = 0L ;
2727 // NOTE just a best effort to run on time
2828 }
2929 // //////////////////////////
@@ -34,11 +34,11 @@ void Devlpr::tick()
3434 // accrue micros on the micros since last run
3535 microsSince[i] += microsDelta;
3636 // check if enough time has passed to run it
37- if (microsSince[i] > schedMicros[i]) {
37+ if (microsSince[i] >= schedMicros[i]) {
3838 // run it
3939 funcs[i](this );
4040 // and update micros since
41- microsSince[i] = 0 ;
41+ microsSince[i] = 0L ;
4242 // NOTE just a best effort to run on time
4343 }
4444 }
Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ class Devlpr
2525 unsigned int emgRunningSum; // if BUFSIZE is small, uint is fine
2626 void readEMG ();
2727 // scheduling
28- unsigned long lastTickMicros = 0 ;
28+ unsigned long lastTickMicros = 0L ;
2929 // emg scheduling
30- static const unsigned long MICROS_SCHED_EMG = 1000 ;
31- unsigned long microsSinceEMG = 0 ;
30+ static const unsigned long MICROS_SCHED_EMG = 1000L ;
31+ unsigned long microsSinceEMG = 0L ;
3232 // user function scheduling
3333 static const byte FUNCMAX = 8 ;
3434 void (*funcs[FUNCMAX])(Devlpr *d);
You can’t perform that action at this time.
0 commit comments