-
Notifications
You must be signed in to change notification settings - Fork 10
/
_timer.h
39 lines (33 loc) · 808 Bytes
/
_timer.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
#ifndef _TIMER_H
#define _TIMER_H
#include <SimpleTimer.h>
#include <WiFiUdp.h>
SimpleTimer timer;
void blynkInitEvent();
void blynkCheckEvent();
void syncTime();
void ringTimer();
void timerInit()
{
Timer[MSG_TIMER] = timer.setInterval(10, MSGEvent);
timer.disable(Timer[MSG_TIMER]);
Timer[FX_TIMER] = timer.setInterval(10, FXEvent);
timer.disable(Timer[FX_TIMER]);
timer.setInterval(10, TimeUpdateEvent);
timer.setTimeout(5000, TimeAutoStartEvent);
timer.setInterval(10000, blynkCheckEvent);
timer.setInterval(14400000,syncTime);
Timer[ALARM_TIMER] = timer.setInterval(10,ringTimer);
timer.disable(Timer[ALARM_TIMER]);
}
void timerDisabler(int index)
{
for (int x = 0; x < TOTAL_TIMER - 1; x++)
{
if (x != index)
{
timer.disable(Timer[x]);
}
}
}
#endif