Commit 08d9755a authored by Eric Duminil's avatar Eric Duminil
Browse files

Small refactor

Showing with 8 additions and 3 deletions
+8 -3
...@@ -39,5 +39,6 @@ ...@@ -39,5 +39,6 @@
void keepServicesAlive(); void keepServicesAlive();
void checkFlashButton(); void checkFlashButton();
void checkSerialInput();
#endif #endif
...@@ -145,9 +145,7 @@ void loop() { ...@@ -145,9 +145,7 @@ void loop() {
// Short press for night mode, Long press for calibration. // Short press for night mode, Long press for calibration.
checkFlashButton(); checkFlashButton();
while (Serial.available() > 0) { checkSerialInput();
sensor_console::processSerialInput(Serial.read());
}
if (sensor::processData()) { if (sensor::processData()) {
#ifdef AMPEL_CSV #ifdef AMPEL_CSV
...@@ -172,6 +170,12 @@ void loop() { ...@@ -172,6 +170,12 @@ void loop() {
} }
} }
void checkSerialInput() {
while (Serial.available() > 0) {
sensor_console::processSerialInput(Serial.read());
}
}
/** /**
* Checks if flash button has been pressed: * Checks if flash button has been pressed:
* If not, do nothing. * If not, do nothing.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment