From 7f90acae5cd4cc0cc117349d4fd25cf26d5ae25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Fri, 29 Dec 2017 22:33:05 +0100 Subject: [PATCH] Defined new ESPurna switch (no HLW8012 support & touch button ready) --- code/espurna/config/hardware.h | 63 ++++++++++++++++------------------ 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 971740c8..87f47cc3 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -78,23 +78,8 @@ #define BUTTON1_PIN 4 #define BUTTON1_RELAY 1 - #ifdef USE_TOUCH_BUTTON - - // Touch button - #define BUTTON1_MODE BUTTON_PUSHBUTTON - #define BUTTON1_PRESS BUTTON_MODE_TOGGLE - #define BUTTON1_CLICK BUTTON_MODE_NONE - #define BUTTON1_DBLCLICK BUTTON_MODE_NONE - #define BUTTON1_LNGCLICK BUTTON_MODE_NONE - #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE - - #else - - // Normal pushbutton - #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH - - #endif - + // Normal pushbutton + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH // Relays #define RELAY1_PIN 12 @@ -122,22 +107,8 @@ #define BUTTON1_PIN 4 #define BUTTON1_RELAY 1 - #ifdef USE_TOUCH_BUTTON - - // Touch button - #define BUTTON1_MODE BUTTON_PUSHBUTTON - #define BUTTON1_PRESS BUTTON_MODE_TOGGLE - #define BUTTON1_CLICK BUTTON_MODE_NONE - #define BUTTON1_DBLCLICK BUTTON_MODE_NONE - #define BUTTON1_LNGCLICK BUTTON_MODE_NONE - #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE - - #else - - // Normal pushbutton - #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH - - #endif + // Normal pushbutton + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH // Relays #define RELAY1_PIN 12 @@ -155,6 +126,32 @@ #define HLW8012_CF1_PIN 13 #define HLW8012_CF_PIN 14 +#elif defined(TINKERMAN_ESPURNA_SWITCH) + + // Info + #define MANUFACTURER "TINKERMAN" + #define DEVICE "ESPURNA_SWITCH" + + // Buttons + #define BUTTON1_PIN 4 + #define BUTTON1_RELAY 1 + + // Touch button + #define BUTTON1_MODE BUTTON_PUSHBUTTON + #define BUTTON1_PRESS BUTTON_MODE_TOGGLE + #define BUTTON1_CLICK BUTTON_MODE_NONE + #define BUTTON1_DBLCLICK BUTTON_MODE_NONE + #define BUTTON1_LNGCLICK BUTTON_MODE_NONE + #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE + + // LEDs + #define LED1_PIN 2 + #define LED1_PIN_INVERSE 0 + + // Relays + #define RELAY1_PIN 12 + #define RELAY1_TYPE RELAY_TYPE_INVERSE + // ----------------------------------------------------------------------------- // Itead Studio boards // -----------------------------------------------------------------------------