Code maintenance improvements.

This commit is contained in:
Frans Veldman 2025-03-30 00:31:43 +00:00
parent 8b3d6a43db
commit 48ec4be5fe
2 changed files with 18 additions and 9 deletions

View File

@ -1,15 +1,21 @@
// ****** Hardware Model definitions ********
#define ARDUINO_ 0 // Use this one if you want to build this project around an Arduino
#define HWV_1_0 1 // Hardware version 1.0 of the Thermal Optimizer board (only a few were made)
#define HWV_1_1 2 // Hardware version 1.1 of the Thermal Optimizer board
#define HWV_1_2 3 // Hardware version 1.2 of the Thermal Optimizer board
// Do not change these definitions! The numerical order is important!
#define ARDUINO_ 0
#define HWV_1_0 1
#define HWV_1_1 2
#define HWV_1_2 3
// ********* Hardware Model ************
#define HWMODEL ARDUINO_ // Change this into the hardware model you want to compile for
// Uncomment ONE of the following:
#define HWMODEL ARDUINO_ // Use this one if you want to build this project around an Arduino
//#define HWMODEL HWV_1_0 // Use this one if you want to build this project for a ThermalOptimizer board v1.0
//#define HWMODEL HWV_1_1 // Use this one if you want to build this project for a ThermalOptimizer board v1.1
//#define HWMODEL HWV_1_2 // Use this one if you want to build this project for a ThermalOptimizer board v1.2
// Debug definitions, leave commented for production!
//#define SIMTEMP 713 // Use this to test the program without actual temperature sensors connected. 713 simulates 71.3 Celcius
// ******** Debug definitions **********
// Leave commented for production!
//#define SIMTEMP 683 // Use this to test the program without actual temperature sensors connected. 683 simulates 68.3 Celcius
//#define SIMVOLT 141 // Use this to test the program for a specific voltage. 141 simulates 14.1
//#define USEDEFAULT 1 // declutter the EPROM, use the defaults

View File

@ -342,8 +342,8 @@ void setup() {
#ifndef USEDEFAULT
eeprom_read_block((void*)&rom, (void*)0, sizeof(rom)); // These are the configuration settings.
brightness(rom.brightness);
#endif
brightness(rom.brightness);
// Prime the "history" of the temperature. Make sure we start with a downward trend
delay(1500);
@ -684,6 +684,9 @@ void processmodes() {
// Update the temperature trend arrow
lcd.setCursor(13,0);
#ifdef SIMTEMP
lcd.write(6); // Simulate upward trend
#else
if(readtemp(0)-lastTemperature>=TRENDDELTA) {
lcd.write(6); // Trend is going up
lastTemperature=readtemp(0);
@ -692,7 +695,7 @@ void processmodes() {
lcd.write(5); // Trend is going down
lastTemperature=readtemp(0);
}
#endif
lcd.setCursor(14,0);
if(hwv && hwv_timer) { // If the hot water valve is selected...