@@ -2,7 +2,7 @@ | |||||
#define TIME_SYSTEM_H | #define TIME_SYSTEM_H | ||||
#include <Arduino.h> | #include <Arduino.h> | ||||
#include <Time.h> | |||||
#include <TimeLib.h> | |||||
/* | /* | ||||
** Simple helper functions to change and get time | ** Simple helper functions to change and get time | ||||
@@ -206,10 +206,11 @@ void Application::Lighting() | |||||
void Application::Heating() | 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 | // stores the timing of the first reading problem | ||||
if (first_try == 0) | if (first_try == 0) | ||||
@@ -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.DrawImage(Sprites::thermometer_32x32, x, y, 32, 32); | ||||
app->Graphics.Screen.setCursor(x + 26, y + 6); | app->Graphics.Screen.setCursor(x + 26, y + 6); | ||||
if (temperature - DataSaveLoad::ReadThermometerAdjustement() != -1) | |||||
if (temperature != -1) | |||||
app->Graphics.Screen.printf("%.1f°C", temperature); | app->Graphics.Screen.printf("%.1f°C", temperature); | ||||
else | else | ||||
app->Graphics.Screen.printf(". . . . °C"); | app->Graphics.Screen.printf(". . . . °C"); |
@@ -53,7 +53,7 @@ void ThermometerTask(void *parameter) | |||||
if (tempC == -1) | if (tempC == -1) | ||||
DS18B20Temp.StartDevice(); | DS18B20Temp.StartDevice(); | ||||
if (tempC < -1) | |||||
if (tempC < -1 || tempC == 85) //85°C is VCC disconnected | |||||
tempC = -1; // sometime gets -127 for some reason | tempC = -1; // sometime gets -127 for some reason | ||||
// Send temperature to Queue | // Send temperature to Queue | ||||