mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 19:59:50 +03:00
Timer re-interability fix
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1609,7 +1609,7 @@ void postTransmission() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TIMER_INTERVAL_MS 200 // 0.1s = 100ms
|
|
||||||
|
|
||||||
volatile unsigned long timerCount=0;
|
volatile unsigned long timerCount=0;
|
||||||
volatile int16_t timerNumber=-1;
|
volatile int16_t timerNumber=-1;
|
||||||
@@ -2074,8 +2074,10 @@ void modbusIdle(void) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
volatile bool inputLoopBusy = false;
|
||||||
void inputLoop(short cause) {
|
void inputLoop(short cause) {
|
||||||
if (!inputs) return;
|
if (!inputs || inputLoopBusy) return;
|
||||||
|
inputLoopBusy = true;
|
||||||
|
|
||||||
configLocked++;
|
configLocked++;
|
||||||
//if (millis() > timerInputCheck)
|
//if (millis() > timerInputCheck)
|
||||||
@@ -2129,6 +2131,7 @@ configLocked++;
|
|||||||
timerSensorCheck = millis();// + INTERVAL_CHECK_SENSOR;
|
timerSensorCheck = millis();// + INTERVAL_CHECK_SENSOR;
|
||||||
}
|
}
|
||||||
configLocked--;
|
configLocked--;
|
||||||
|
inputLoopBusy= false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2145,7 +2148,7 @@ configLocked++;
|
|||||||
input = input->next;
|
input = input->next;
|
||||||
}
|
}
|
||||||
// Interval in microsecs
|
// Interval in microsecs
|
||||||
attachTimer(TIMER_INTERVAL_MS * 1000, TimerHandler, "ITimer");
|
attachTimer(TIMER_CHECK_INPUT * 1000, TimerHandler, "ITimer");
|
||||||
#endif
|
#endif
|
||||||
configLocked--;
|
configLocked--;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,9 +100,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INTERVAL_CHECK_INPUT
|
#ifndef INTERVAL_CHECK_INPUT
|
||||||
#define INTERVAL_CHECK_INPUT 15
|
#define INTERVAL_CHECK_INPUT 11
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TIMER_CHECK_INPUT
|
||||||
|
#define TIMER_CHECK_INPUT 15
|
||||||
|
#endif
|
||||||
#ifndef INTERVAL_CHECK_SENSOR
|
#ifndef INTERVAL_CHECK_SENSOR
|
||||||
#define INTERVAL_CHECK_SENSOR 5000
|
#define INTERVAL_CHECK_SENSOR 5000
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user