From 4b6a4acd9d732a27463e1d591ad130eb9d1f2ed9 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Sat, 29 Sep 2018 18:52:18 -0700 Subject: [PATCH 1/2] Fix for YiDian XS-SSA05 configs --- code/espurna/config/hardware.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index b837fce9..b522f328 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1932,7 +1932,7 @@ // Buttons #define BUTTON1_PIN 13 - #define BUTTON1_MODE BUTTON_PUSHBUTTON + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH #define BUTTON1_RELAY 1 // Relays @@ -1940,9 +1940,14 @@ #define RELAY1_TYPE RELAY_TYPE_NORMAL // LEDs - #define LED1_PIN 4 - #define LED1_PIN_INVERSE 0 - + #define LED1_PIN 0 // red + #define LED1_PIN_INVERSE 1 + #define LED1_MODE LED_MODE_WIFI + + #define LED2_PIN 15 // blue + #define LED2_PIN_INVERSE 1 + #define LED2_MODE LED_MODE_RELAY + // HLW8012 #ifndef HLW8012_SUPPORT #define HLW8012_SUPPORT 1 @@ -1953,6 +1958,8 @@ #define HLW8012_CURRENT_R 0.001 // Current resistor #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor + #define HLW8012_SEL_CURRENT LOW + #define HLW8012_INTERRUPT_ON FALLING // ----------------------------------------------------------------------------- // TONBUX XS-SSA06 From 2929425a2b6b6c4dd816dc2b4316664bf6269c38 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Tue, 2 Oct 2018 01:08:00 -0700 Subject: [PATCH 2/2] Copy over HJL-01 parameters from another device --- code/espurna/config/hardware.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index b522f328..2603fce9 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1956,10 +1956,11 @@ #define HLW8012_CF1_PIN 14 #define HLW8012_CF_PIN 5 - #define HLW8012_CURRENT_R 0.001 // Current resistor - #define HLW8012_VOLTAGE_R_UP ( 2 * 1200000 ) // Upstream voltage resistor - #define HLW8012_SEL_CURRENT LOW - #define HLW8012_INTERRUPT_ON FALLING + #define HLW8012_SEL_CURRENT LOW + #define HLW8012_CURRENT_RATIO 25740 + #define HLW8012_VOLTAGE_RATIO 313400 + #define HLW8012_POWER_RATIO 3414290 + #define HLW8012_INTERRUPT_ON FALLING // ----------------------------------------------------------------------------- // TONBUX XS-SSA06