-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcuve.cpp
More file actions
70 lines (54 loc) · 1.06 KB
/
cuve.cpp
File metadata and controls
70 lines (54 loc) · 1.06 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <Arduino.h>
#include <util/delay.h>
// local includes
#include "counters.h"
#include "config.h"
#include "interrupt.h"
#include "level.h"
#include "lpm.h"
#include "network.h"
void setup()
{
Serial.begin(57600);
interrupt_setup();
lpm_setup();
counters_setup();
level_setup();
network_setup();
Serial.println("Enjoy distance sensor: ");
}
void loop()
{
Serial.println("loop");
if (serialEventRun) serialEventRun();
interrupt_loop();
#if 0
static uint8_t count = 0;
if (count++ == 0)
{
Serial.print("Distance: ");
Serial.println(level_get_distance());
}
#endif
#if 1
SettingsCounters counters;
counters_get(counters);
counters_log("global", counters);
// counters_commit();
#endif
// network_loop();
// Serial.println(__FUNCTION__);
// Serial.print("\train high: ");
// Serial.println(GPIO_GET_IN(TANK_INT_RAIN_HIGH));
Serial.flush();
lpm_sleep();
}
int main(void)
{
init();
setup();
for (;;) {
loop();
}
return 0;
}