Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Sonoff Bridge optional by define #6648

Merged
merged 6 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sonoff/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions sonoff/sonoff_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion sonoff/support_features.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 4 additions & 2 deletions sonoff/xdrv_01_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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>"));
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions sonoff/xdrv_06_snfbridge.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -584,3 +586,5 @@ bool Xdrv06(uint8_t function)
}
return result;
}

#endif // USE_RF_BRIDGE
2 changes: 1 addition & 1 deletion tools/decode-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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","","",
"","","","",
"","","","",
"","","","",
Expand Down