-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
48 lines (34 loc) · 906 Bytes
/
main.py
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
# Main entry point
import gc;
import time;
import globs;
import debug;
try: #{
gc.collect();
print("\n\n");
print("[MAIN ] Main entry point");
if (globs.mode == globs.MODE_CONFIG): #{
print("[MAIN ] Mode: Config");
import config;
config.launch_app();
time.sleep(2); # 2 secs
# Hard reset
import machine;
machine.reset();
elif (globs.mode == globs.MODE_APP): #{
print("[MAIN ] Mode: App");
import app;
app.main();
time.sleep(2); # 2 secs
# Hard reset
import machine;
machine.reset();
elif (globs.mode == globs.MODE_DEBUG): #{
print("[MAIN ] Mode: Debug");
# Fall through after debug exits - Once we exit, REPL will happen
#}
except KeyboardInterrupt: #}{
print("Break");
debug.debug_mode();
#}
# vim:ts=4:tw=80:sw=4:et:ai:si