diff --git a/compiled/due/firmware.bin b/compiled/due/firmware.bin index 2ba0647..ec96918 100755 Binary files a/compiled/due/firmware.bin and b/compiled/due/firmware.bin differ diff --git a/compiled/lighthub21/firmware.bin b/compiled/lighthub21/firmware.bin index cec85bc..5c0d3ad 100644 Binary files a/compiled/lighthub21/firmware.bin and b/compiled/lighthub21/firmware.bin differ diff --git a/lighthub/main.cpp b/lighthub/main.cpp index ed85ab2..1744ec4 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -1609,7 +1609,7 @@ void postTransmission() { #endif } -#define TIMER_INTERVAL_MS 200 // 0.1s = 100ms + volatile unsigned long timerCount=0; volatile int16_t timerNumber=-1; @@ -2074,8 +2074,10 @@ void modbusIdle(void) { #endif } +volatile bool inputLoopBusy = false; void inputLoop(short cause) { - if (!inputs) return; + if (!inputs || inputLoopBusy) return; +inputLoopBusy = true; configLocked++; //if (millis() > timerInputCheck) @@ -2129,6 +2131,7 @@ configLocked++; timerSensorCheck = millis();// + INTERVAL_CHECK_SENSOR; } configLocked--; +inputLoopBusy= false; } @@ -2145,7 +2148,7 @@ configLocked++; input = input->next; } // Interval in microsecs - attachTimer(TIMER_INTERVAL_MS * 1000, TimerHandler, "ITimer"); + attachTimer(TIMER_CHECK_INPUT * 1000, TimerHandler, "ITimer"); #endif configLocked--; } diff --git a/lighthub/options.h b/lighthub/options.h index 3c650a6..78c73ac 100644 --- a/lighthub/options.h +++ b/lighthub/options.h @@ -100,9 +100,12 @@ */ #ifndef INTERVAL_CHECK_INPUT -#define INTERVAL_CHECK_INPUT 15 +#define INTERVAL_CHECK_INPUT 11 #endif +#ifndef TIMER_CHECK_INPUT +#define TIMER_CHECK_INPUT 15 +#endif #ifndef INTERVAL_CHECK_SENSOR #define INTERVAL_CHECK_SENSOR 5000 #endif