Skip to content

Commit 94643e2

Browse files
author
CK1
committed
interrupt function - overflow
1 parent 7260a11 commit 94643e2

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/main.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@
1010

1111
void interruptDoorFunction() // Interrupt Function for DoorSwitch
1212
{
13-
long diff = millis() - oldTime;
14-
if (diff < 0) //The millis() function will overflow (go back to zero), after approximately 50 days. (Max value = 4.294.967.295)
15-
{
16-
diff=debounceTime;
17-
}
18-
19-
if (millis() - oldTime >= debounceTime) // Debouncing/Entprellung Switch
13+
if (millis() - oldTime > debounceTime) // Debouncing/Entprellung Switch - The millis() function will overflow (go back to zero), after approximately 50 days. (Max value = 4.294.967.295)
2014
{
2115
door_state = 0;
2216
watchdog = 0; // Real Alarm // Watchdog/Heartbeat, Differentiation between watchdog and real alarm. 1=WatchDogSignal 0=Real DoorAlarm

0 commit comments

Comments
 (0)