From ac7075dcd19a334ced9721258c2f7bb5ff3c7424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Metrich?= <45318189+FredM67@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:22:58 +0100 Subject: [PATCH] Intermediate fix temp --- Mk2_3phase_RFdatalog_temp/config.h | 18 +++++++----------- Mk2_3phase_RFdatalog_temp/utils_temp.h | 1 + 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Mk2_3phase_RFdatalog_temp/config.h b/Mk2_3phase_RFdatalog_temp/config.h index 8a382aeb..cf081074 100644 --- a/Mk2_3phase_RFdatalog_temp/config.h +++ b/Mk2_3phase_RFdatalog_temp/config.h @@ -13,7 +13,7 @@ #define _CONFIG_H //-------------------------------------------------------------------------------------------------- -//#define TEMP_ENABLED /**< this line must be commented out if the temperature sensor is not present */ +//#define TEMP_ENABLED /**< this line must be commented out if the temperature sensor is not present */ //#define RF_PRESENT /**< this line must be commented out if the RFM12B module is not present */ // Output messages @@ -51,8 +51,8 @@ inline constexpr bool OVERRIDE_PIN_PRESENT{ false }; /**< set #endif inline constexpr bool WATCHDOG_PIN_PRESENT{ true }; /**< set it to 'true' if there's a watch led */ -inline constexpr bool RELAY_DIVERSION{ false }; /**< set it to 'true' if a relay is used for diversion */ -inline constexpr bool DUAL_TARIFF{ false }; /**< set it to 'true' if there's a dual tariff each day AND the router is connected to the billing meter */ +inline constexpr bool RELAY_DIVERSION{ false }; /**< set it to 'true' if a relay is used for diversion */ +inline constexpr bool DUAL_TARIFF{ false }; /**< set it to 'true' if there's a dual tariff each day AND the router is connected to the billing meter */ // ----------- Pinout assignments ----------- // @@ -73,7 +73,7 @@ inline constexpr bool DUAL_TARIFF{ false }; /**< set it to 'true' if th // D13 is SCK inline constexpr uint8_t physicalLoadPin[NO_OF_DUMPLOADS]{ 5, 6, 7 }; /**< for 3-phase PCB, Load #1/#2/#3 (Rev 2 PCB) */ -inline constexpr uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS]{ 0, 1, 2}; /**< load priorities and states at startup */ +inline constexpr uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS]{ 0, 1, 2 }; /**< load priorities and states at startup */ // Set the value to 0xff when the pin is not needed (feature deactivated) inline constexpr uint8_t relayPin{ 0xff }; /**< for 3-phase PCB, relay trigger */ @@ -81,9 +81,9 @@ inline constexpr uint8_t dualTariffPin{ 0xff }; /**< for 3-phase PCB, off-peak t inline constexpr uint8_t diversionPin{ 0xff }; /**< if LOW, set diversion on standby */ inline constexpr uint8_t rotationPin{ 0xff }; /**< if LOW, trigger a load priority rotation */ inline constexpr uint8_t forcePin{ 0xff }; /**< for 3-phase PCB, force pin */ -inline constexpr uint8_t watchDogPin{ 4 }; /**< watch dog LED */ +inline constexpr uint8_t watchDogPin{ 4 }; /**< watch dog LED */ -inline constexpr uint8_t tempSensorPin{ 0xff }; /**< for 3-phase PCB, sensor pin */ +inline constexpr uint8_t tempSensorPin{ 10 }; /**< for 3-phase PCB, sensor pin */ inline constexpr relayOutput relay_Output{ relayPin, 1000, 200, 1, 1 }; /**< config for relay diversion, see class definition for defaults and advanced options */ @@ -92,11 +92,7 @@ inline constexpr pairForceLoad rg_ForceLoad[NO_OF_DUMPLOADS]{ { -3, 2 } }; /**< inline constexpr int16_t iTemperatureThreshold{ 100 }; /**< the temperature threshold to stop overriding in °C */ -inline constexpr DeviceAddress sensorAddrs[]{ { 0x28, 0xBE, 0x41, 0x6B, 0x09, 0x00, 0x00, 0xA4 }, - { 0x28, 0xED, 0x5B, 0x6A, 0x09, 0x00, 0x00, 0x9D }, - { 0x28, 0xDB, 0x6D, 0x6A, 0x09, 0x00, 0x00, 0xDA }, - { 0x28, 0x59, 0x1F, 0x6A, 0x09, 0x00, 0x00, 0xB0 }, - { 0x28, 0x1B, 0xD7, 0x6A, 0x09, 0x00, 0x00, 0xB7 } }; /**< list of temperature sensor Addresses */ +inline constexpr DeviceAddress sensorAddrs[]{ { 0x28, 0xE9, 0xD1, 0xB0, 0x1B, 0x13, 0x01, 0xCF } }; /**< list of temperature sensor Addresses */ inline constexpr uint32_t ROTATION_AFTER_CYCLES{ 8UL * 3600UL * SUPPLY_FREQUENCY }; /**< rotates load priorities after this period of inactivity */ diff --git a/Mk2_3phase_RFdatalog_temp/utils_temp.h b/Mk2_3phase_RFdatalog_temp/utils_temp.h index 9ab61950..66c9a692 100644 --- a/Mk2_3phase_RFdatalog_temp/utils_temp.h +++ b/Mk2_3phase_RFdatalog_temp/utils_temp.h @@ -15,6 +15,7 @@ #include #include "constants.h" +#include "config.h" using ScratchPad = uint8_t[9]; using DeviceAddress = uint8_t[8];