Skip to content

Commit d1bb038

Browse files
committed
WIP: Stop over sending
1 parent 5c59d5a commit d1bb038

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/components/analogIO/Wippersnapper_AnalogIO.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,6 @@ void Wippersnapper_AnalogIO::update() {
371371
// Does the pin execute on_change?
372372
else if (_analog_input_pins[i].period == 0L) {
373373

374-
WS_DEBUG_PRINT(F("CurrentTime: "));
375-
WS_DEBUG_PRINTLN(millis());
376-
WS_DEBUG_PRINT(F("PrvPeriod: "));
377-
WS_DEBUG_PRINTLN(_analog_input_pins[i].prvPeriod);
378-
WS_DEBUG_PRINT(F("Diff: "));
379-
WS_DEBUG_PRINTLN((long)millis() - _analog_input_pins[i].prvPeriod);
380-
381374
// if (_analog_input_pins[i].prvPeriod == 0L) {
382375
// // last time was a clean event, passed hyteresis or 300ms had elapsed
383376
// WS_DEBUG_PRINTLN("prvPeriod is 0, last time was a clean event, "
@@ -454,9 +447,7 @@ void Wippersnapper_AnalogIO::update() {
454447
// waiting 200ms before posting the next final movement event (or
455448
// continued movement events), to avoid a flood of events when twisting
456449
// pots
457-
if (passed_hysterisys &&
458-
(((long)millis() - _analog_input_pins[i].prvPeriod) > 200 ||
459-
_analog_input_pins[i].prvPeriod == 0L)) {
450+
if (passed_hysterisys && ((long)millis() - _analog_input_pins[i].prvPeriod) > 200) {
460451
WS_DEBUG_PRINTLN(F("ADC has changed enough, publishing event..."));
461452
_analog_input_pins[i].prvPinVal = pinValRaw;
462453
_analog_input_pins[i].prvPeriod = millis();

0 commit comments

Comments
 (0)