diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index c1845b540e62..8e473743765b 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -531,6 +531,7 @@ #define USE_HX711 // Add support for HX711 load cell (+1k5 code) // #define USE_HX711_GUI // Add optional web GUI to HX711 as scale (+1k8 code) +#define USE_RF_BRIDGE // Add support for Rf Bridge #define USE_RF_FLASH // Add support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB (+3k code) //#define USE_TX20_WIND_SENSOR // Add support for La Crosse TX20 anemometer (+2k code) diff --git a/sonoff/sonoff_template.h b/sonoff/sonoff_template.h index 27532404f74b..e51f136632d8 100644 --- a/sonoff/sonoff_template.h +++ b/sonoff/sonoff_template.h @@ -775,7 +775,9 @@ const uint8_t kModuleNiceList[] PROGMEM = { SONOFF_IFAN02, // Sonoff Fan SONOFF_IFAN03, #endif +#ifdef USE_RF_BRIDGE SONOFF_BRIDGE, // Sonoff Bridge +#endif SONOFF_SV, // Sonoff Development Devices SONOFF_DEV, CH1, // Relay Devices diff --git a/sonoff/support_features.ino b/sonoff/support_features.ino index 3e92d7a937c2..99ad95f2157d 100644 --- a/sonoff/support_features.ino +++ b/sonoff/support_features.ino @@ -468,7 +468,9 @@ void GetFeatures(void) #ifdef USE_SONOFF_SC feature5 |= 0x00001000; #endif -// feature5 |= 0x00002000; +#ifdef USE_RF_BRIDGE + feature5 |= 0x00002000; +#endif // feature5 |= 0x00004000; // feature5 |= 0x00008000; diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index e59cfb3e77d2..a40564d47873 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -1046,6 +1046,7 @@ void HandleRoot(void) #endif // USE_SONOFF_IFAN WSContentSend_P(PSTR("")); } +#ifdef USE_RF_BRIDGE if (SONOFF_BRIDGE == my_module_type) { WSContentSend_P(HTTP_TABLE100); WSContentSend_P(PSTR("")); @@ -1059,7 +1060,8 @@ void HandleRoot(void) } WSContentSend_P(PSTR("")); } - +#endif // USE_RF_BRIDGE + #ifndef FIRMWARE_MINIMAL XdrvCall(FUNC_WEB_ADD_MAIN_BUTTON); XsnsCall(FUNC_WEB_ADD_MAIN_BUTTON); @@ -2100,7 +2102,7 @@ void HandleUploadLoop(void) Web.config_block_count = 0; } else { -#ifdef USE_RF_FLASH +#if (defined (USE_RF_FLASH) && defined(USE_RF_BRIDGE)) if ((SONOFF_BRIDGE == my_module_type) && (upload.buf[0] == ':')) { // Check if this is a RF bridge FW file Update.end(); // End esp8266 update session Web.upload_file_type = UPL_EFM8BB1; diff --git a/sonoff/xdrv_06_snfbridge.ino b/sonoff/xdrv_06_snfbridge.ino index 67ca582fbfc4..7afb5b450854 100644 --- a/sonoff/xdrv_06_snfbridge.ino +++ b/sonoff/xdrv_06_snfbridge.ino @@ -21,6 +21,8 @@ Sonoff RF Bridge 433 \*********************************************************************************************/ +#ifdef USE_RF_BRIDGE + #define XDRV_06 6 const uint32_t SFB_TIME_AVOID_DUPLICATE = 2000; // Milliseconds @@ -584,3 +586,5 @@ bool Xdrv06(uint8_t function) } return result; } + +#endif // USE_RF_BRIDGE diff --git a/tools/decode-status.py b/tools/decode-status.py index 0e7c7520443d..04caaeae6040 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -172,7 +172,7 @@ "USE_BUZZER","USE_RDM6300","USE_IBEACON","USE_SML_M", "USE_INA226","USE_A4988_Stepper","USE_DDS2382","USE_SM2135", "USE_SHUTTER","USE_PCF8574","USE_DDSU666","USE_DEEPSLEEP", - "USE_SONOFF_SC","","","", + "USE_SONOFF_SC","USE_RF_BRIDGE","","", "","","","", "","","","", "","","","",