-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZTimer.h
39 lines (36 loc) · 913 Bytes
/
ZTimer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#define DEBUG
#ifndef _ZTimer_H_
#define _ZTimer_H_
#define LIBRARY_VERSION 0.0.1
static void nothing(void) {
}
class ZTimer {
public:
typedef void (*ZvoidFuncPtr)(void);// Create a type to point to a funciton.
ZTimer();
bool CheckTime();
ZTimer & SetCallBack(void (*CB)(void));
ZTimer & StopTimer();
ZTimer & StartTimer();
ZTimer & ResetTimer(bool r = true);
ZTimer & SetWaitTime(unsigned long Time);
ZTimer & SetLastTime(unsigned long Time);
ZTimer & Pause();
ZTimer & Every();
ZTimer & After();
ZTimer & Millis();
ZTimer & Micros();
ZTimer & This();
unsigned long GetNow();
unsigned long WaitTime();
unsigned long LastTime();
volatile ZvoidFuncPtr _CB = nothing;
unsigned long waitTime;
bool everyTime;
bool micro;
bool restart;
bool enableFlag;
unsigned long lastTime;
unsigned long remainingTime;
};
#endif