File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -376,19 +376,8 @@ void Wippersnapper_AnalogIO::update() {
376376 // Does the pin execute on_change?
377377 else if (_analog_input_pins[i].period == 0L ) {
378378
379- // TODO: after testing combine these two conditionals to just send the
380- // event and not debug print.
381- if (_analog_input_pins[i].prvPeriod == 0L ) {
382- // first time reading pin, no previous timestamp so send event +
383- // update prvPeriod WS_DEBUG_PRINT("First time reading pin A");
384- // WS_DEBUG_PRINTLN(_analog_input_pins[i].pinName);
385- } else if (timerExpired (millis (), _analog_input_pins[i], 500 )) {
386- // timer expired, send event + update prvPeriod
387- // WS_DEBUG_PRINT("Timer passed for pin A");
388- // WS_DEBUG_PRINTLN(_analog_input_pins[i].pinName);
389- } else {
390- // last event was too recently, skip this one...
391- // WS_DEBUG_PRINTLN("Timer has not expired, continue...");
379+ // not first run and timer not expired, skip
380+ if (_analog_input_pins[i].prvPeriod != 0L && !timerExpired (millis (), _analog_input_pins[i], 500 )) {
392381 continue ;
393382 }
394383
You can’t perform that action at this time.
0 commit comments