mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
Clean code
Clean code
This commit is contained in:
parent
54364484fa
commit
7965ada5c5
@ -609,19 +609,3 @@ void EspRestart(void)
|
|||||||
// ESP.restart(); // This results in exception 3 on restarts on core 2.3.0
|
// ESP.restart(); // This results in exception 3 on restarts on core 2.3.0
|
||||||
ESP.reset();
|
ESP.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void EspRestart(void)
|
|
||||||
{
|
|
||||||
ESP.restart();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void WifiAddDelayWhenDisconnected(void)
|
|
||||||
{
|
|
||||||
if (APP_BAUDRATE == baudrate) { // When baudrate too low it will fail on Sonoff Pow R2 and S31 serial interface initialization
|
|
||||||
if (global_state.wifi_down) {
|
|
||||||
delay(DRIVER_BOOT_DELAY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -881,7 +881,6 @@ bool XdrvCall(uint8_t Function)
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
for (uint32_t x = 0; x < xdrv_present; x++) {
|
for (uint32_t x = 0; x < xdrv_present; x++) {
|
||||||
// WifiAddDelayWhenDisconnected();
|
|
||||||
result = xdrv_func_ptr[x](Function);
|
result = xdrv_func_ptr[x](Function);
|
||||||
|
|
||||||
if (result && ((FUNC_COMMAND == Function) ||
|
if (result && ((FUNC_COMMAND == Function) ||
|
||||||
|
@ -870,13 +870,19 @@ bool XsnsNextCall(uint8_t Function, uint8_t &xsns_index)
|
|||||||
{
|
{
|
||||||
xsns_index++;
|
xsns_index++;
|
||||||
if (xsns_index == xsns_present) { xsns_index = 0; }
|
if (xsns_index == xsns_present) { xsns_index = 0; }
|
||||||
#ifdef USE_DEBUG_DRIVER
|
|
||||||
while (!XsnsEnabled(xsns_index) && !xsns_index) { // Perform at least first sensor (counter)
|
#ifndef USE_DEBUG_DRIVER
|
||||||
|
if (FUNC_WEB_SENSOR == Function) { // Skip web info for disabled sensors
|
||||||
|
#endif
|
||||||
|
uint32_t max_disabled = xsns_present;
|
||||||
|
while (!XsnsEnabled(xsns_index) && max_disabled--) { // Perform at least one sensor
|
||||||
xsns_index++;
|
xsns_index++;
|
||||||
if (xsns_index == xsns_present) { xsns_index = 0; }
|
if (xsns_index == xsns_present) { xsns_index = 0; }
|
||||||
}
|
}
|
||||||
|
#ifndef USE_DEBUG_DRIVER
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
// WifiAddDelayWhenDisconnected();
|
|
||||||
return xsns_func_ptr[xsns_index](Function);
|
return xsns_func_ptr[xsns_index](Function);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -890,7 +896,7 @@ bool XsnsCall(uint8_t Function)
|
|||||||
|
|
||||||
for (uint32_t x = 0; x < xsns_present; x++) {
|
for (uint32_t x = 0; x < xsns_present; x++) {
|
||||||
#ifdef USE_DEBUG_DRIVER
|
#ifdef USE_DEBUG_DRIVER
|
||||||
if (XsnsEnabled(x)) {
|
if (XsnsEnabled(x)) { // Skip disabled sensor in debug mode
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((FUNC_WEB_SENSOR == Function) && !XsnsEnabled(x)) { continue; } // Skip web info for disabled sensors
|
if ((FUNC_WEB_SENSOR == Function) && !XsnsEnabled(x)) { continue; } // Skip web info for disabled sensors
|
||||||
@ -898,7 +904,6 @@ bool XsnsCall(uint8_t Function)
|
|||||||
#ifdef PROFILE_XSNS_SENSOR_EVERY_SECOND
|
#ifdef PROFILE_XSNS_SENSOR_EVERY_SECOND
|
||||||
uint32_t profile_start_millis = millis();
|
uint32_t profile_start_millis = millis();
|
||||||
#endif // PROFILE_XSNS_SENSOR_EVERY_SECOND
|
#endif // PROFILE_XSNS_SENSOR_EVERY_SECOND
|
||||||
// WifiAddDelayWhenDisconnected();
|
|
||||||
result = xsns_func_ptr[x](Function);
|
result = xsns_func_ptr[x](Function);
|
||||||
|
|
||||||
#ifdef PROFILE_XSNS_SENSOR_EVERY_SECOND
|
#ifdef PROFILE_XSNS_SENSOR_EVERY_SECOND
|
||||||
|
Loading…
x
Reference in New Issue
Block a user