Browse Source

Support for Sonoff Dual R2

fastled
Xose Pérez 7 years ago
parent
commit
dc96649240
3 changed files with 63 additions and 0 deletions
  1. +26
    -0
      code/espurna/config/hardware.h
  2. +16
    -0
      code/espurna/hardware.ino
  3. +21
    -0
      code/platformio.ini

+ 26
- 0
code/espurna/config/hardware.h View File

@ -330,6 +330,32 @@
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
#elif defined(ITEAD_SONOFF_DUAL_R2)
#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_DUAL_R2"
// Buttons
#define BUTTON1_PIN 0
#define BUTTON2_PIN 9
#define BUTTON3_PIN 10
#define BUTTON1_RELAY 1
#define BUTTON2_RELAY 2
#define BUTTON3_RELAY 1
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
// Relays
#define RELAY1_PIN 12
#define RELAY2_PIN 5
#define RELAY1_TYPE RELAY_TYPE_NORMAL
#define RELAY2_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
#elif defined(ITEAD_SONOFF_4CH)
// Info


+ 16
- 0
code/espurna/hardware.ino View File

@ -587,6 +587,22 @@ void hwUpwardsCompatibility() {
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
setSetting("relayType", 2, RELAY_TYPE_NORMAL);
#elif defined(ITEAD_SONOFF_DUAL_R2)
setSetting("board", 48);
setSetting("ledGPIO", 1, 13);
setSetting("ledLogic", 1, 1);
setSetting("btnGPIO", 1, 0);
setSetting("btnGPIO", 2, 9);
setSetting("btnGPIO", 3, 10);
setSetting("btnRelay", 1, 1);
setSetting("btnRelay", 2, 2);
setSetting("btnRelay", 3, 1);
setSetting("relayGPIO", 1, 12);
setSetting("relayGPIO", 2, 5);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
setSetting("relayType", 2, RELAY_TYPE_NORMAL);
#else
#error "UNSUPPORTED HARDWARE!"


+ 21
- 0
code/platformio.ini View File

@ -296,6 +296,27 @@ upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
[env:itead-sonoff-dual-r2]
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_1m} -DITEAD_SONOFF_DUAL_R2
[env:itead-sonoff-dual-ota-r2]
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_1m} -DITEAD_SONOFF_DUAL_R2
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
[env:itead-sonoff-4ch]
platform = ${common.platform}
framework = arduino


Loading…
Cancel
Save