use limits.h
This commit is contained in:
parent
6d3ee6202a
commit
babb27e5ea
1 changed files with 2 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <limits.h>
|
||||
/*
|
||||
* es gibt folgende Zustände:
|
||||
* 0 - Aus
|
||||
|
@ -17,9 +18,6 @@
|
|||
#define TIME_HALF 5400000 // 1,5h
|
||||
#define TIME_OFF 7200000 // 2h
|
||||
|
||||
// für Variablen Überlauf in calcStateTime
|
||||
#define MAX_LONG 4294967295
|
||||
|
||||
// Ein-/Ausgänge Bezeichnen
|
||||
const int BTN_ON = 2; // Einschalter
|
||||
const int BTN_OFF = 3; // Ausschalter
|
||||
|
@ -134,7 +132,7 @@ unsigned long calcStateTime() {
|
|||
if (millis() - stateBegan >= 0) {
|
||||
return millis() - stateBegan;
|
||||
} else {
|
||||
return millis() + (MAX_LONG - stateBegan);
|
||||
return millis() + (ULONG_MAX - stateBegan);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue