mirror of https://github.com/arendst/Tasmota.git
Refactor GPIO_HEARTBEAT
Remove delay from interrupt by refactoring GPIO_HEARTBEAT
This commit is contained in:
parent
871bc9700e
commit
85731148c5
|
@ -377,12 +377,6 @@ void RtcSecond(void)
|
|||
static uint32_t last_sync = 0;
|
||||
static bool mutex = false;
|
||||
|
||||
if ((TasmotaGlobal.init_state >= INIT_GPIOS) && PinUsed(GPIO_HEARTBEAT)) {
|
||||
digitalWrite(Pin(GPIO_HEARTBEAT), ~TasmotaGlobal.heartbeat_inverted &1);
|
||||
delayMicroseconds(50);
|
||||
digitalWrite(Pin(GPIO_HEARTBEAT), TasmotaGlobal.heartbeat_inverted);
|
||||
}
|
||||
|
||||
if (mutex) { return; }
|
||||
|
||||
if (Rtc.time_synced) {
|
||||
|
|
|
@ -983,6 +983,12 @@ void PerformEverySecond(void)
|
|||
|
||||
ResetGlobalValues();
|
||||
|
||||
if ((TasmotaGlobal.init_state >= INIT_GPIOS) && PinUsed(GPIO_HEARTBEAT)) {
|
||||
digitalWrite(Pin(GPIO_HEARTBEAT), ~TasmotaGlobal.heartbeat_inverted &1);
|
||||
delayMicroseconds(50);
|
||||
digitalWrite(Pin(GPIO_HEARTBEAT), TasmotaGlobal.heartbeat_inverted);
|
||||
}
|
||||
|
||||
if (Settings->tele_period || (3601 == TasmotaGlobal.tele_period)) {
|
||||
if (TasmotaGlobal.tele_period >= 9999) {
|
||||
if (!TasmotaGlobal.global_state.network_down) {
|
||||
|
|
Loading…
Reference in New Issue