2020-03-19 02:15:51 +00:00
|
|
|
#pragma once
|
2020-02-22 20:01:59 +00:00
|
|
|
|
2020-02-28 05:45:20 +00:00
|
|
|
#include <Fsm.h>
|
2020-02-22 20:01:59 +00:00
|
|
|
|
|
|
|
// See sw-design.md for documentation
|
|
|
|
|
2020-03-19 02:15:51 +00:00
|
|
|
#define EVENT_PRESS 1
|
2020-02-22 20:01:59 +00:00
|
|
|
#define EVENT_WAKE_TIMER 2
|
|
|
|
#define EVENT_RECEIVED_PACKET 3
|
|
|
|
#define EVENT_PACKET_FOR_PHONE 4
|
|
|
|
#define EVENT_RECEIVED_TEXT_MSG 5
|
2020-03-18 22:00:17 +00:00
|
|
|
// #define EVENT_BOOT 6 // now done with a timed transition
|
2020-02-23 02:02:44 +00:00
|
|
|
#define EVENT_BLUETOOTH_PAIR 7
|
2020-03-19 02:15:51 +00:00
|
|
|
#define EVENT_NODEDB_UPDATED 8 // NodeDB has a big enough change that we think you should turn on the screen
|
2020-02-23 16:53:52 +00:00
|
|
|
#define EVENT_CONTACT_FROM_PHONE 9 // the phone just talked to us over bluetooth
|
2020-09-21 19:41:39 +00:00
|
|
|
#define EVENT_LOW_BATTERY 10 // Battery is critically low, go to sleep
|
2020-06-08 23:35:26 +00:00
|
|
|
#define EVENT_SERIAL_CONNECTED 11
|
|
|
|
#define EVENT_SERIAL_DISCONNECTED 12
|
2020-09-21 19:41:39 +00:00
|
|
|
#define EVENT_POWER_CONNECTED 13
|
|
|
|
#define EVENT_POWER_DISCONNECTED 14
|
2020-02-22 20:01:59 +00:00
|
|
|
|
2020-02-22 21:14:10 +00:00
|
|
|
extern Fsm powerFSM;
|
2020-10-12 01:27:07 +00:00
|
|
|
extern State statePOWER, stateSERIAL;
|
2020-02-22 21:14:10 +00:00
|
|
|
|
2020-02-28 05:45:20 +00:00
|
|
|
void PowerFSM_setup();
|