From 6ad8554c25e845792f6a28370596a0ab5295836a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20K=C3=A4ppler?= <michael_kaeppler@web.de>
Date: Wed, 28 Apr 2021 21:14:38 +0200
Subject: [PATCH] co2_sensor: set measurement interval at last

---
 ampel-firmware/co2_sensor.cpp | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/ampel-firmware/co2_sensor.cpp b/ampel-firmware/co2_sensor.cpp
index 5795697..e532065 100644
--- a/ampel-firmware/co2_sensor.cpp
+++ b/ampel-firmware/co2_sensor.cpp
@@ -80,13 +80,6 @@ namespace sensor {
 
     switchState(BOOTUP);
 
-    // SCD30 has its own timer.
-    //NOTE: The timer seems to be inaccurate, though, possibly depending on voltage. Should it be offset?
-    Serial.print(F("Setting SCD30 timestep to "));
-    Serial.print(config::measurement_timestep);
-    Serial.println(" s.");
-    scd30.setMeasurementInterval(config::measurement_timestep); // [s]
-
     Serial.print(F("Setting temperature offset to -"));
     Serial.print(abs(config::temperature_offset));
     Serial.println(" K.");
@@ -100,6 +93,14 @@ namespace sensor {
     Serial.print(F("Auto-calibration is "));
     Serial.println(config::auto_calibrate_sensor ? "ON." : "OFF.");
 
+    // SCD30 has its own timer.
+    //NOTE: The timer seems to be inaccurate, though, possibly depending on voltage. Should it be offset?
+    Serial.println();
+    Serial.print(F("Setting SCD30 timestep to "));
+    Serial.print(config::measurement_timestep);
+    Serial.println(" s.");
+    scd30.setMeasurementInterval(config::measurement_timestep); // [s]
+
     sensor_console::defineIntCommand("co2", setCO2forDebugging, F(" 1500 (Sets co2 level, for debugging purposes)"));
     sensor_console::defineIntCommand("timer", setTimer, F(" 30 (Sets measurement interval, in s)"));
     sensor_console::defineCommand("calibrate", startCalibrationProcess, F(" (Starts calibration process)"));
-- 
GitLab