From 79f137e85204b24c80c6c9c3bc9c148a0833c10d Mon Sep 17 00:00:00 2001 From: Eric Duminil <eric.duminil@gmail.com> Date: Fri, 30 Apr 2021 16:18:45 +0200 Subject: [PATCH] co2_sensor: Add F-Strings --- ampel-firmware/co2_sensor.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ampel-firmware/co2_sensor.cpp b/ampel-firmware/co2_sensor.cpp index 31db6ee..cac1c78 100644 --- a/ampel-firmware/co2_sensor.cpp +++ b/ampel-firmware/co2_sensor.cpp @@ -84,13 +84,13 @@ namespace sensor { Serial.print(F("Setting temperature offset to -")); Serial.print(abs(config::temperature_offset)); - Serial.println(" K."); + Serial.println(F(" K.")); scd30.setTemperatureOffset(abs(config::temperature_offset)); // setTemperatureOffset only accepts positive numbers, but shifts the temperature down. delay(100); Serial.print(F("Temperature offset is : -")); Serial.print(scd30.getTemperatureOffset()); - Serial.println(" K"); + Serial.println(F(" K")); Serial.print(F("Auto-calibration is ")); Serial.println(config::auto_calibrate_sensor ? "ON." : "OFF."); @@ -100,7 +100,7 @@ namespace sensor { Serial.println(); Serial.print(F("Setting SCD30 timestep to ")); Serial.print(config::measurement_timestep_bootup); - Serial.println(" s during acclimatization."); + Serial.println(F(" s during acclimatization.")); scd30.setMeasurementInterval(config::measurement_timestep_bootup); // [s] sensor_console::defineIntCommand("co2", setCO2forDebugging, F(" 1500 (Sets co2 level, for debugging purposes)")); @@ -120,7 +120,7 @@ namespace sensor { int32_t now = millis(); Serial.print(F("Measurement time offset : ")); Serial.print(now - previous_measurement_at - config::measurement_timestep * 1000); - Serial.println(" ms."); + Serial.println(F(" ms.")); previous_measurement_at = now; } @@ -189,7 +189,7 @@ namespace sensor { if (config::debug_sensor_states) { Serial.print(F("Changing sensor state: ")); Serial.print(state_names[current_state]); - Serial.print(" -> "); + Serial.print(F(" -> ")); Serial.println(state_names[new_state]); } current_state = new_state; @@ -204,7 +204,7 @@ namespace sensor { Serial.println(F("Sensor acclimatization finished.")); Serial.print(F("Setting SCD30 timestep to ")); Serial.print(config::measurement_timestep); - Serial.println(" s."); + Serial.println(F(" s.")); scd30.setMeasurementInterval(config::measurement_timestep); // [s] } if ((current_state == PREPARE_CALIBRATION_UNSTABLE) || (current_state == PREPARE_CALIBRATION_STABLE)) { @@ -306,7 +306,7 @@ namespace sensor { if (timestep >= 2 && timestep <= 1800) { Serial.print(F("Setting Measurement Interval to : ")); Serial.print(timestep); - Serial.println("s."); + Serial.println(F("s.")); sensor::scd30.setMeasurementInterval(timestep); config::measurement_timestep = timestep; led_effects::showKITTWheel(color::green, 1); @@ -318,7 +318,7 @@ namespace sensor { Serial.print(F("Force calibration, at ")); config::co2_calibration_level = calibrationLevel; Serial.print(config::co2_calibration_level); - Serial.println(" ppm."); + Serial.println(F(" ppm.")); sensor::startCalibrationProcess(); } } -- GitLab