diff --git a/MK3_Firmware/include/TimeSystem.h b/MK3_Firmware/include/TimeSystem.h index e6d2009..a10c2b1 100644 --- a/MK3_Firmware/include/TimeSystem.h +++ b/MK3_Firmware/include/TimeSystem.h @@ -2,7 +2,7 @@ #define TIME_SYSTEM_H #include -#include +#include /* ** Simple helper functions to change and get time diff --git a/MK3_Firmware/src/App.cpp b/MK3_Firmware/src/App.cpp index 0bf4b5b..f9ff8dd 100644 --- a/MK3_Firmware/src/App.cpp +++ b/MK3_Firmware/src/App.cpp @@ -206,10 +206,11 @@ void Application::Lighting() void Application::Heating() { - float temperature = GetCurrentTemperature(); + float temperature; + xQueuePeek(temperatureQueue, &temperature, 0); - static uint64_t first_try = 0; - if (temperature == -1) // if there is a problem with the temperature + static unsigned long first_try = 0; + if (temperature <= -1) // if there is a problem with the temperature { // stores the timing of the first reading problem if (first_try == 0) diff --git a/MK3_Firmware/src/Scenes/SceneMainMenu.cpp b/MK3_Firmware/src/Scenes/SceneMainMenu.cpp index d76a0c1..e74691b 100644 --- a/MK3_Firmware/src/Scenes/SceneMainMenu.cpp +++ b/MK3_Firmware/src/Scenes/SceneMainMenu.cpp @@ -108,7 +108,7 @@ void SceneMainMenu::DrawTemperature(uint16_t x, uint16_t y, float temperature) app->Graphics.DrawImage(Sprites::thermometer_32x32, x, y, 32, 32); app->Graphics.Screen.setCursor(x + 26, y + 6); - if (temperature - DataSaveLoad::ReadThermometerAdjustement() != -1) + if (temperature != -1) app->Graphics.Screen.printf("%.1f°C", temperature); else app->Graphics.Screen.printf(". . . . °C"); diff --git a/MK3_Firmware/src/Tasks/TaskThermometer.cpp b/MK3_Firmware/src/Tasks/TaskThermometer.cpp index 64cf1cc..b2e7808 100644 --- a/MK3_Firmware/src/Tasks/TaskThermometer.cpp +++ b/MK3_Firmware/src/Tasks/TaskThermometer.cpp @@ -53,7 +53,7 @@ void ThermometerTask(void *parameter) if (tempC == -1) DS18B20Temp.StartDevice(); - if (tempC < -1) + if (tempC < -1 || tempC == 85) //85°C is VCC disconnected tempC = -1; // sometime gets -127 for some reason // Send temperature to Queue