Browse Source

fix comment about clock cycles

rules-rpn
Max Prokhorov 5 years ago
parent
commit
38a950c294
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      code/espurna/sensors/EventSensor.h

+ 4
- 2
code/espurna/sensors/EventSensor.h View File

@ -126,8 +126,10 @@ class EventSensor : public BaseSensor {
(void) gpio;
static unsigned long last = 0;
// ~27000ms when F_CPU is 80MHz
// ~12000ms when F_CPU is 160MHz
// clock count in 32bit value, overflowing:
// ~53s when F_CPU is 80MHz
// ~26s when F_CPU is 160MHz
// see: cores/esp8266/Arduino.h definitions
unsigned long ms = clockCyclesToMicroseconds(ESP.getCycleCount()) / 1000u;
if (ms - last > _debounce) {


Loading…
Cancel
Save