mirror of https://github.com/arendst/Tasmota.git
Fix yield panics
This commit is contained in:
parent
31b01b5178
commit
74acc90d23
|
@ -17,6 +17,9 @@
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
IPAddress syslog_host_addr; // Syslog host IP address
|
||||||
|
unsigned long syslog_host_refresh = 0;
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Watchdog extension (https://github.com/esp8266/Arduino/issues/1532)
|
* Watchdog extension (https://github.com/esp8266/Arduino/issues/1532)
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
@ -1153,8 +1156,11 @@ void syslog()
|
||||||
// Destroys log_data
|
// Destroys log_data
|
||||||
char syslog_preamble[64]; // Hostname + Id
|
char syslog_preamble[64]; // Hostname + Id
|
||||||
|
|
||||||
yield(); // Fix possible UDP syslog blocking
|
if ((static_cast<uint32_t>(syslog_host_addr) == 0) || ((millis() - syslog_host_refresh) > 60000)) {
|
||||||
if (portUDP.beginPacket(sysCfg.syslog_host, sysCfg.syslog_port)) {
|
WiFi.hostByName(sysCfg.syslog_host, syslog_host_addr);
|
||||||
|
syslog_host_refresh = millis();
|
||||||
|
}
|
||||||
|
if (portUDP.beginPacket(syslog_host_addr, sysCfg.syslog_port)) {
|
||||||
snprintf_P(syslog_preamble, sizeof(syslog_preamble), PSTR("%s ESP-"), Hostname);
|
snprintf_P(syslog_preamble, sizeof(syslog_preamble), PSTR("%s ESP-"), Hostname);
|
||||||
memmove(log_data + strlen(syslog_preamble), log_data, sizeof(log_data) - strlen(syslog_preamble));
|
memmove(log_data + strlen(syslog_preamble), log_data, sizeof(log_data) - strlen(syslog_preamble));
|
||||||
log_data[sizeof(log_data) -1] = '\0';
|
log_data[sizeof(log_data) -1] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue