Browse Source

small fixes

main
David 2 years ago
parent
commit
86b6d7d329
4 changed files with 7 additions and 6 deletions
  1. +1
    -1
      MK3_Firmware/include/TimeSystem.h
  2. +4
    -3
      MK3_Firmware/src/App.cpp
  3. +1
    -1
      MK3_Firmware/src/Scenes/SceneMainMenu.cpp
  4. +1
    -1
      MK3_Firmware/src/Tasks/TaskThermometer.cpp

+ 1
- 1
MK3_Firmware/include/TimeSystem.h View File

@@ -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


+ 4
- 3
MK3_Firmware/src/App.cpp View File

@@ -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)


+ 1
- 1
MK3_Firmware/src/Scenes/SceneMainMenu.cpp View File

@@ -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");

+ 1
- 1
MK3_Firmware/src/Tasks/TaskThermometer.cpp View File

@@ -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


Loading…
Cancel
Save