mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
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 uint32_t last_sync = 0;
|
||||||
static bool mutex = false;
|
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 (mutex) { return; }
|
||||||
|
|
||||||
if (Rtc.time_synced) {
|
if (Rtc.time_synced) {
|
||||||
|
@ -983,6 +983,12 @@ void PerformEverySecond(void)
|
|||||||
|
|
||||||
ResetGlobalValues();
|
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 (Settings->tele_period || (3601 == TasmotaGlobal.tele_period)) {
|
||||||
if (TasmotaGlobal.tele_period >= 9999) {
|
if (TasmotaGlobal.tele_period >= 9999) {
|
||||||
if (!TasmotaGlobal.global_state.network_down) {
|
if (!TasmotaGlobal.global_state.network_down) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user