From aedbff583d25e0909770e3e9b8fc50f1a6747384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 8 Apr 2018 11:27:55 +0200 Subject: [PATCH] Fix ARNIEX_SWIFITCH definitions --- code/espurna/config/arduino.h | 1 + code/espurna/config/hardware.h | 57 ++++++++++++++++++---------------- code/platformio.ini | 36 ++++++++++++++------- 3 files changed, 55 insertions(+), 39 deletions(-) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index a7f358c3..35c36836 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -70,6 +70,7 @@ //#define TONBUX_XSSSA06 //#define GREEN_ESP8266RELAY //#define IKE_ESPIKE +//#define ARNIEX_SWIFITCH //-------------------------------------------------------------------------------- // Features (values below are non-default values) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 4a936f4c..0f202cc9 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -51,33 +51,6 @@ // Development boards // ----------------------------------------------------------------------------- -#elif defined(SWIFITCH) - // https://github.com/ArnieX/swifitch - - // Info - #define MANUFACTURER "SWIFITCH" - #define DEVICE "SWIFITCH" - - // Buttons - #define BUTTON1_PIN 4 // D2 - #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH - #define BUTTON1_RELAY 1 - - #define BUTTON1_PRESS BUTTON_MODE_NONE - #define BUTTON1_CLICK BUTTON_MODE_TOGGLE - #define BUTTON1_DBLCLICK BUTTON_MODE_NONE - #define BUTTON1_LNGCLICK BUTTON_MODE_NONE - #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE - - - // Relays - #define RELAY1_PIN 5 // D1 - #define RELAY1_TYPE RELAY_TYPE_INVERSE - - // LEDs - #define LED1_PIN 12 // D6 - #define LED1_PIN_INVERSE 1 - #elif defined(NODEMCU_LOLIN) // Info @@ -1794,6 +1767,36 @@ #define LED1_PIN 2 #define LED1_PIN_INVERSE 1 +// ----------------------------------------------------------------------------- +// SWIFITCH +// https://github.com/ArnieX/swifitch +// ----------------------------------------------------------------------------- + +#elif defined(ARNIEX_SWIFITCH) + + // Info + #define MANUFACTURER "ARNIEX" + #define DEVICE "SWIFITCH" + + // Buttons + #define BUTTON1_PIN 4 // D2 + #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH + #define BUTTON1_RELAY 1 + + #define BUTTON1_PRESS BUTTON_MODE_NONE + #define BUTTON1_CLICK BUTTON_MODE_TOGGLE + #define BUTTON1_DBLCLICK BUTTON_MODE_NONE + #define BUTTON1_LNGCLICK BUTTON_MODE_NONE + #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE + + // Relays + #define RELAY1_PIN 5 // D1 + #define RELAY1_TYPE RELAY_TYPE_INVERSE + + // LEDs + #define LED1_PIN 12 // D6 + #define LED1_PIN_INVERSE 1 + // ----------------------------------------------------------------------------- // TEST boards (do not use!!) // ----------------------------------------------------------------------------- diff --git a/code/platformio.ini b/code/platformio.ini index 0b1ea03e..0d1dd602 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1723,6 +1723,30 @@ upload_port = "${env.ESPURNA_IP}" upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 extra_scripts = ${common.extra_scripts} +[env:arniex-swifitch] +platform = ${common.platform} +framework = arduino +board = esp12e +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DARNIEX_SWIFITCH +extra_scripts = ${common.extra_scripts} +monitor_baud = 115200 + +[env:arniex-swifitch-ota] +platform = ${common.platform} +framework = arduino +board = esp12e +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DARNIEX_SWIFITCH +upload_speed = 115200 +upload_port = "${env.ESPURNA_IP}" +upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 +extra_scripts = ${common.extra_scripts} + # ------------------------------------------------------------------------------ # GENERIC OTA ENVIRONMENTS # ------------------------------------------------------------------------------ @@ -1753,18 +1777,6 @@ upload_port = "${env.ESPURNA_IP}" upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 extra_scripts = ${common.extra_scripts} -[env:swifitch] -platform = espressif8266@1.6.0 -framework = arduino -board = nodemcuv2 -board_flash_mode = dout -lib_deps = ${common.lib_deps} -lib_ignore = ${common.lib_ignore} -build_flags = ${common.build_flags_1m} -DSWIFITCH -extra_scripts = ${common.extra_scripts} -monitor_baud = 115200 - - # ------------------------------------------------------------------------------ # SPECIAL BUILDS - DO. NOT. USE. ever --- # ------------------------------------------------------------------------------