mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 05:36:39 +00:00
Make Sonoff Sc optional by define
Make Sonoff Sc optional by define (#6640)
This commit is contained in:
parent
d57153630f
commit
f5b932a6d5
@ -308,6 +308,7 @@
|
||||
// #define SUPPORT_MQTT_EVENT // Support trigger event with MQTT subscriptions (+3k5 code)
|
||||
|
||||
// -- Optional modules ----------------------------
|
||||
#define USE_SONOFF_SC // Add support for Sonoff Sc (+1k1 code)
|
||||
#define USE_BUZZER // Add support for a buzzer (+0k6 code)
|
||||
#define USE_SONOFF_IFAN // Add support for Sonoff iFan02 and iFan03 (+2k code)
|
||||
#define USE_TUYA_MCU // Add support for Tuya Serial MCU
|
||||
|
@ -1211,6 +1211,7 @@ void SerialInput(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_SONOFF_SC
|
||||
/*-------------------------------------------------------------------------------------------*\
|
||||
* Sonoff SC 19200 baud serial interface
|
||||
\*-------------------------------------------------------------------------------------------*/
|
||||
@ -1222,11 +1223,11 @@ void SerialInput(void)
|
||||
Serial.flush();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} else
|
||||
#endif // USE_SONOFF_SC
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
|
||||
else if (!Settings.flag.mqtt_serial && (serial_in_byte == '\n')) {
|
||||
if (!Settings.flag.mqtt_serial && (serial_in_byte == '\n')) {
|
||||
serial_in_buffer[serial_in_byte_counter] = 0; // Serial data completed
|
||||
seriallog_level = (Settings.seriallog_level < LOG_LEVEL_INFO) ? (uint8_t)LOG_LEVEL_INFO : Settings.seriallog_level;
|
||||
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_COMMAND "%s"), serial_in_buffer);
|
||||
@ -1400,11 +1401,13 @@ void GpioInit(void)
|
||||
devices_present = 4;
|
||||
baudrate = 19200;
|
||||
}
|
||||
#ifdef USE_SONOFF_SC
|
||||
else if (SONOFF_SC == my_module_type) {
|
||||
Settings.flag.mqtt_serial = 0;
|
||||
devices_present = 0;
|
||||
baudrate = 19200;
|
||||
}
|
||||
#endif // USE_SONOFF_SC
|
||||
|
||||
if (!light_type) {
|
||||
for (uint32_t i = 0; i < MAX_PWMS; i++) { // Basic PWM control only
|
||||
|
@ -768,7 +768,9 @@ const uint8_t kModuleNiceList[] PROGMEM = {
|
||||
#endif
|
||||
SONOFF_B1, // Sonoff Light Bulbs
|
||||
SLAMPHER,
|
||||
#ifdef USE_SONOFF_SC
|
||||
SONOFF_SC, // Sonoff Environmemtal Sensor
|
||||
#endif
|
||||
#ifdef USE_SONOFF_IFAN
|
||||
SONOFF_IFAN02, // Sonoff Fan
|
||||
SONOFF_IFAN03,
|
||||
|
@ -465,8 +465,9 @@ void GetFeatures(void)
|
||||
#ifdef USE_DEEPSLEEP
|
||||
feature5 |= 0x00000800; // Xdrv_029_deepsleep.ino
|
||||
#endif
|
||||
|
||||
// feature5 |= 0x00001000;
|
||||
#ifdef USE_SONOFF_SC
|
||||
feature5 |= 0x00001000;
|
||||
#endif
|
||||
// feature5 |= 0x00002000;
|
||||
// feature5 |= 0x00004000;
|
||||
// feature5 |= 0x00008000;
|
||||
|
@ -17,6 +17,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef USE_SONOFF_SC
|
||||
/*********************************************************************************************\
|
||||
Sonoff Sc
|
||||
|
||||
@ -173,3 +174,5 @@ bool Xsns04(uint8_t function)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif // USE_SONOFF_SC
|
||||
|
@ -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","","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
|
Loading…
x
Reference in New Issue
Block a user