From 7c401454245eb7a581c9b2c771dbd676f7f708eb Mon Sep 17 00:00:00 2001 From: Sebastiaan Jansen Date: Sun, 2 Sep 2018 18:48:11 +0200 Subject: [PATCH] added PHYX support --- code/espurna/config/arduino.h | 1 + code/espurna/config/hardware.h | 18 ++++++++++++++++++ code/espurna/debug.ino | 7 ++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index fe03a421..95e58625 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -97,6 +97,7 @@ //#define YJZK_SWITCH_3CH //#define XIAOMI_SMART_DESK_LAMP //#define ALLTERCO_SHELLY2 +#define PHYX_ESP12_RGB //-------------------------------------------------------------------------------- // Features (values below are non-default values) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 9df3e3ba..a7320578 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -2927,6 +2927,24 @@ #define LLMNR_SUPPORT 1 #define NETBIOS_SUPPORT 1 #define SSDP_SUPPORT 1 + +#elif defined(PHYX_ESP12_RGB) + + // Info + #define MANUFACTURER "PHYX" + #define DEVICE "ESP12_RGB" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER + #define DUMMY_RELAY_COUNT 1 + + // Light + #define LIGHT_CHANNELS 3 + #define LIGHT_CH1_PIN 4 // RED + #define LIGHT_CH2_PIN 14 // GREEN + #define LIGHT_CH3_PIN 12 // BLUE + #define LIGHT_CH1_INVERSE 0 + #define LIGHT_CH2_INVERSE 0 + #define LIGHT_CH3_INVERSE 0 #endif diff --git a/code/espurna/debug.ino b/code/espurna/debug.ino index 7eea7ccb..218d1af3 100644 --- a/code/espurna/debug.ino +++ b/code/espurna/debug.ino @@ -207,7 +207,7 @@ void debugSetup() { * This function is called automatically if ESP8266 suffers an exception * It should be kept quick / consise to be able to execute before hardware wdt may kick in */ -extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack_start, uint32_t stack_end ) { +/*extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack_start, uint32_t stack_end ) { // This method assumes EEPROM has already been initialized // which is the first thing ESPurna does @@ -232,7 +232,8 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack EEPROMr.put(SAVE_CRASH_EEPROM_OFFSET + SAVE_CRASH_STACK_END, stack_end); // write stack trace to EEPROM - int16_t current_address = SAVE_CRASH_EEPROM_OFFSET + SAVE_CRASH_STACK_TRACE; + int16_t current_address = SAVE_CRASH_EEPROM_OFF +ET + SAVE_CRASH_STACK_TRACE; for (uint32_t i = stack_start; i < stack_end; i++) { byte* byteValue = (byte*) i; EEPROMr.write(current_address++, *byteValue); @@ -240,7 +241,7 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack EEPROMr.commit(); -} +}*/ /** * Clears crash info