Browse Source

support for Lingan SWA1

support for Lingan SWA1
rfm69
gn0st1c 6 years ago
parent
commit
7506f0542b
4 changed files with 60 additions and 2 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +25
    -2
      code/espurna/config/hardware.h
  3. +10
    -0
      code/espurna/migrate.ino
  4. +24
    -0
      code/platformio.ini

+ 1
- 0
code/espurna/config/arduino.h View File

@ -63,6 +63,7 @@
//#define GIZWITS_WITTY_CLOUD
//#define EUROMATE_WIFI_STECKER_SCHUKO
//#define TONBUX_POWERSTRIP02
//#define LINGAN_SWA1
//--------------------------------------------------------------------------------
// Features (values below are non-default values)


+ 25
- 2
code/espurna/config/hardware.h View File

@ -1561,9 +1561,32 @@
// LEDs
#define LED1_PIN 0 // 1 blue led
#define LED1_PIN_INVERSE 0
#define LED1_PIN_INVERSE 1
#define LED2_PIN 3 // 3 red leds
#define LED2_PIN_INVERSE 0
#define LED2_PIN_INVERSE 1
// -----------------------------------------------------------------------------
// Lingan SWA1
// -----------------------------------------------------------------------------
#elif defined(LINGAN_SWA1)
// Info
#define MANUFACTURER "LINGAN"
#define DEVICE "SWA1"
// Buttons
#define BUTTON1_PIN 13
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 5
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 4
#define LED1_PIN_INVERSE 1
// -----------------------------------------------------------------------------
// TEST boards (do not use!!)


+ 10
- 0
code/espurna/migrate.ino View File

@ -759,6 +759,16 @@ void migrate() {
setSetting("btnGPIO", 0, 5);
setSetting("btnRelay", 0, 0);
#elif defined(LINGAN_SWA1)
setSetting("board", 57);
setSetting("ledGPIO", 0, 4);
setSetting("ledLogic", 0, 1);
setSetting("btnGPIO", 0, 13);
setSetting("btnRelay", 0, 0);
setSetting("relayGPIO", 0, 5);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
#else
// Allow users to define new settings without migration config


+ 24
- 0
code/platformio.ini View File

@ -1497,6 +1497,30 @@ upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
extra_scripts = ${common.extra_scripts}
[env:lingan-swa1]
platform = ${common.platform}
framework = arduino
board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags} -DLINGAN_SWA1
monitor_baud = 115200
extra_scripts = ${common.extra_scripts}
[env:lingan-swa1-ota]
platform = ${common.platform}
framework = arduino
board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags} -DLINGAN_SWA1
upload_speed = 115200
upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
extra_scripts = ${common.extra_scripts}
[env:stm-relay]
platform = ${common.platform}
framework = arduino


Loading…
Cancel
Save