From 9c4e747b506630461eace1782fbbda80ad4ff139 Mon Sep 17 00:00:00 2001 From: Ollo Date: Sun, 10 Mar 2024 16:53:54 +0100 Subject: [PATCH] Added Compatibilitymode for hardware revision 0.7 --- esp32/include/ControllerConfiguration.h | 29 +++++++++++++++++++++++-- esp32/platformio.ini | 2 ++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/esp32/include/ControllerConfiguration.h b/esp32/include/ControllerConfiguration.h index bba6e78..d604244 100644 --- a/esp32/include/ControllerConfiguration.h +++ b/esp32/include/ControllerConfiguration.h @@ -54,6 +54,15 @@ #define SENSOR_PLANT5 GPIO_NUM_39 /**< SENSOR_VIN */ #define SENSOR_PLANT6 GPIO_NUM_36 /**< SENSOR_VP */ +#ifdef HWREVISION07 +#define OUTPUT_PUMP0 GPIO_NUM_17 /**< GPIO 17 */ +#define OUTPUT_PUMP1 GPIO_NUM_5 /**< GPIO 5 */ +#define OUTPUT_PUMP2 GPIO_NUM_18 /**< GPIO 18 */ +#define OUTPUT_PUMP3 GPIO_NUM_19 /**< GPIO 19 */ +#define OUTPUT_PUMP4 GPIO_NUM_21 /**< GPIO 21 */ +#define OUTPUT_PUMP5 GPIO_NUM_22 /**< GPIO 22 */ +#define OUTPUT_PUMP6 GPIO_NUM_23 /**< GPIO 23 */ +#else #define OUTPUT_PUMP0 GPIO_NUM_15 /**< GPIO 15 */ #define OUTPUT_PUMP1 GPIO_NUM_5 /**< GPIO 5 */ #define OUTPUT_PUMP2 GPIO_NUM_18 /**< GPIO 18 */ @@ -61,10 +70,15 @@ #define OUTPUT_PUMP4 GPIO_NUM_21 /**< GPIO 21 */ #define OUTPUT_PUMP5 GPIO_NUM_22 /**< GPIO 22 */ #define OUTPUT_PUMP6 GPIO_NUM_23 /**< GPIO 23 */ +#endif #define OUTPUT_ENABLE_SENSOR GPIO_NUM_14 /**< GPIO 14 - Enable Sensors */ #define OUTPUT_ENABLE_PUMP GPIO_NUM_13 /**< GPIO 13 - Enable Pumps */ +#ifdef HWREVISION07 +#define SENSOR_ONEWIRE GPIO_NUM_2 /** GPIO 02 - Temperatur sensor, Battery and other cool onewire stuff */ +#else #define SENSOR_ONEWIRE GPIO_NUM_4 /**< GPIO 12 - Temperatur sensor, Battery and other cool onewire stuff */ +#endif #ifdef ANALOG_WATER #define SENSOR_TANK_ANALOG ANALOG_WATER /**< GPIO 34 - analog water sensor (GPIO_NUM_34) */ #else @@ -75,7 +89,11 @@ #define CUSTOM1_PIN1 GPIO_NUM_34 /** direct gpio */ #define CUSTOM1_PIN3 GPIO_NUM_35 /** direct gpio */ +#ifdef HWREVISION07 +#define CUSTOM1_PIN5 GPIO_NUM_4 /** mosfet controlled */ +#else #define CUSTOM1_PIN5 GPIO_NUM_2 /** mosfet controlled */ +#endif #define CUSTOM1_PIN7 GPIO_NUM_12 /** mosfet controlled */ /* @} */ @@ -98,12 +116,19 @@ #ifdef TIMED_LIGHT_PIN #define FIRMWARE_FEATURE2 "Light" #else - #define FIRMWARE_FEATURE2 "" + #define FIRMWARE_FEATURE2 "" #endif + #define FIRMWARE_BASENAME "PlantControl" #define FIRMWARE_NAME FIRMWARE_BASENAME FIRMWARE_FEATURE1 FIRMWARE_FEATURE2 -#define FIRMWARE_VERSION "3.01 HW0.10b" + +#ifdef HWREVISION07 + #define FIRMWARE_VERSION "3.01 HW0.7" +#else + #define FIRMWARE_VERSION "3.01 HW0.10b" +#endif + #define MOIST_SENSOR_MAX_FRQ 5200 // 60kHz (500Hz margin) #define MOIST_SENSOR_MIN_FRQ 500 // 0.5kHz (500Hz margin) diff --git a/esp32/platformio.ini b/esp32/platformio.ini index f048010..892fee2 100644 --- a/esp32/platformio.ini +++ b/esp32/platformio.ini @@ -23,6 +23,8 @@ build_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY -DTIMED_LIGHT_PIN=CUSTOM1_PIN5 -DFLOWMETER_PIN=CUSTOM1_PIN1 -DANALOG_WATER=GPIO_NUM_34 + ; Optional: Compatibilitymode for hardware revision 0.7 + ;-DHWREVISION07=1 board_build.partitions = defaultWithSmallerSpiffs.csv