diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index fe35cd67..4c50b0e6 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -63,26 +63,32 @@ // ESPurna // ----------------------------------------------------------------------------- -#elif defined(TINKERMAN_ESPURNA_H) +#elif defined(TINKERMAN_ESPURNA_H06) // Info #define MANUFACTURER "TINKERMAN" - #define DEVICE "ESPURNA_H" + #define DEVICE "ESPURNA_H06" // Buttons #define BUTTON1_PIN 4 #define BUTTON1_RELAY 1 - // Normal pushbutton - //#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + #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 + // 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 // Relays @@ -99,6 +105,47 @@ #define HLW8012_CF1_PIN 13 #define HLW8012_CF_PIN 14 +#elif defined(TINKERMAN_ESPURNA_H07) + + // Info + #define MANUFACTURER "TINKERMAN" + #define DEVICE "ESPURNA_H07" + + // Buttons + #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 + + // Relays + #define RELAY1_PIN 12 + #define RELAY1_TYPE RELAY_TYPE_NORMAL + + // LEDs + #define LED1_PIN 2 + #define LED1_PIN_INVERSE 0 + + // HLW8012 + #define POWER_PROVIDER POWER_PROVIDER_HLW8012 + #define HLW8012_SEL_PIN 5 + #define HLW8012_CF1_PIN 13 + #define HLW8012_CF_PIN 14 + // ----------------------------------------------------------------------------- // Itead Studio boards // ----------------------------------------------------------------------------- diff --git a/code/espurna/hardware.ino b/code/espurna/hardware.ino index d11f6a7d..4b0b1095 100644 --- a/code/espurna/hardware.ino +++ b/code/espurna/hardware.ino @@ -252,7 +252,7 @@ void hwUpwardsCompatibility() { setSetting("relayGPIO", 1, 12); setSetting("relayType", 1, RELAY_TYPE_NORMAL); - #elif defined(TINKERMAN_ESPURNA_H) + #elif defined(TINKERMAN_ESPURNA_H06) setSetting("board", 23); setSetting("ledGPIO", 1, 5); @@ -442,6 +442,19 @@ void hwUpwardsCompatibility() { setSetting("board", 38); + #elif defined(TINKERMAN_ESPURNA_H07) + + setSetting("board", 39); + setSetting("ledGPIO", 1, 2); + setSetting("ledLogic", 1, 0); + setSetting("btnGPIO", 1, 4); + setSetting("btnRelay", 1, 1); + setSetting("relayGPIO", 1, 12); + setSetting("relayType", 1, RELAY_TYPE_NORMAL); + setSetting("selGPIO", 5); + setSetting("cf1GPIO", 13); + setSetting("cfGPIO", 14); + #else #error "UNSUPPORTED HARDWARE!" diff --git a/code/html/index.html b/code/html/index.html index 1e7dc867..e1a34fe1 100644 --- a/code/html/index.html +++ b/code/html/index.html @@ -401,12 +401,6 @@