Browse Source

Support for IteadStudio BN-SZ01

fastled
Xose Pérez 7 years ago
parent
commit
1bc4a26005
3 changed files with 51 additions and 9 deletions
  1. +11
    -0
      code/espurna/config/hardware.h
  2. +19
    -9
      code/espurna/hardware.ino
  3. +21
    -0
      code/platformio.ini

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

@ -222,6 +222,17 @@
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
#elif defined(ITEAD_BNSZ01)
#define MANUFACTURER "ITEAD"
#define DEVICE "BN-SZ01"
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define LIGHT_CH1_PIN 12
#define LIGHT_CH1_INVERSE 0
// -----------------------------------------------------------------------------
// Electrodragon boards
// -----------------------------------------------------------------------------


+ 19
- 9
code/espurna/hardware.ino View File

@ -230,10 +230,10 @@ void hwUpwardsCompatibility() {
setSetting("ch2GPIO", 5);
setSetting("ch3GPIO", 12);
setSetting("ch4GPIO", 13);
setSetting("ch1Logic", 1);
setSetting("ch2Logic", 1);
setSetting("ch3Logic", 1);
setSetting("ch4Logic", 1);
setSetting("ch1Logic", 0);
setSetting("ch2Logic", 0);
setSetting("ch3Logic", 0);
setSetting("ch4Logic", 0);
#endif
#ifdef ITEAD_MOTOR
@ -267,11 +267,21 @@ void hwUpwardsCompatibility() {
setSetting("ch3GPIO", 12);
setSetting("ch4GPIO", 14);
setSetting("ch5GPIO", 4);
setSetting("ch1Logic", 1);
setSetting("ch2Logic", 1);
setSetting("ch3Logic", 1);
setSetting("ch4Logic", 1);
setSetting("ch5Logic", 1);
setSetting("ch1Logic", 0);
setSetting("ch2Logic", 0);
setSetting("ch3Logic", 0);
setSetting("ch4Logic", 0);
setSetting("ch5Logic", 0);
#endif
#ifdef ITEAD_BNSZ01
setSetting("board", 25);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("ledGPIO", 13, 1);
setSetting("ledLogic", 1, 1);
setSetting("ch1GPIO", 12);
setSetting("ch1Logic", 0);
#endif
saveSettings();


+ 21
- 0
code/platformio.ini View File

@ -461,3 +461,24 @@ build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DH801_LED_CONTROLLER -DDEBUG_PORT=S
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
[env:bnsz01-debug]
platform = espressif8266
framework = arduino
board = esp8285
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m} -DITEAD_BNSZ01
[env:bnsz01-debug-ota]
platform = espressif8266
framework = arduino
board = esp8285
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m} -DITEAD_BNSZ01
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266

Loading…
Cancel
Save