-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmode_resume.cpp
More file actions
38 lines (32 loc) · 823 Bytes
/
mode_resume.cpp
File metadata and controls
38 lines (32 loc) · 823 Bytes
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
#include "uni_keypad.h"
#include "uni_gps.h"
#include "uni_display.h"
#include "uni_buzzer.h"
#include "modes.h"
extern UniKeypad keypad;
extern UniGps gps;
extern UniDisplay display;
#include <Fsm.h>
#include "mode_fsm.h"
extern Fsm mode_fsm;
/*********************************************************************************** */
//### Mode Resume - GPS lock requirement before entering Mode 5 or Mode 6
//
//- Displays a moving pattern while waiting for GPS lock
//- Once GPS lock, moves into the target mode
//
// *****************************************************
// Mode Resume FSM
void mode_resume_setup() {
display.clear();
}
void mode_resume_loop() {
gps.readData();
if (gps.lock()) {
mode_fsm.trigger(MODE_GPS_LOCK);
} else {
display.waiting(false);
}
}
void mode_resume_teardown() {
}