Merge pull request #6648 from Jason2866/patch-2

Make Sonoff Bridge optional by define
This commit is contained in:
Theo Arends 2019-10-15 14:46:08 +02:00 committed by GitHub
commit 9ced81175d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -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;

View File

@ -1046,6 +1046,7 @@ void HandleRoot(void)
#endif // USE_SONOFF_IFAN
WSContentSend_P(PSTR("</tr></table>"));
}
#ifdef USE_RF_BRIDGE
if (SONOFF_BRIDGE == my_module_type) {
WSContentSend_P(HTTP_TABLE100);
WSContentSend_P(PSTR("<tr>"));
@ -1059,7 +1060,8 @@ void HandleRoot(void)
}
WSContentSend_P(PSTR("</tr></table>"));
}
#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;

View File

@ -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

View File

@ -172,7 +172,7 @@ a_features = [[
"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","","",
"","","","",
"","","","",
"","","","",