Browse Source

Move HLW8012 toggling to pre-loop

fastled
Xose Pérez 7 years ago
parent
commit
d25ac6cd88
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      code/espurna/power_hlw8012.ino

+ 7
- 5
code/espurna/power_hlw8012.ino View File

@ -141,17 +141,19 @@ void _powerLoopProvider(bool before) {
static unsigned long last = 0;
if (millis() - last > POWER_READ_INTERVAL) {
last = millis();
_power_newdata = true;
// Toggle between current and voltage monitoring
#if (HLW8012_USE_INTERRUPTS == 0)
_hlw8012.toggleMode();
#endif // (HLW8012_USE_INTERRUPTS == 0)
}
} else {
// Toggle between current and voltage monitoring
#if (HLW8012_USE_INTERRUPTS == 0)
_hlw8012.toggleMode();
#endif // (HLW8012_USE_INTERRUPTS == 0)
}
}


Loading…
Cancel
Save