-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSWatchFSM.h
More file actions
50 lines (44 loc) · 1.11 KB
/
Copy pathSWatchFSM.h
File metadata and controls
50 lines (44 loc) · 1.11 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
/**
******************************************************************************
* @file SWatchFSM.h
* @author Paolo Sassi
* @date 22 January 2016
* @brief Contains the definition of the FSM and the definitions of its
* signals and states.
******************************************************************************
*/
#ifndef SWATCHFSM_H_
#define SWATCHFSM_H_
#include "Cplus.h"
#include "stm32f4xx.h"
/**
* @addtogroup fsmdef FSM Definition
* @{
*/
/**
* @brief FSM signals.
*/
typedef enum {
watch_b, swatch_b, alarm_b, timer_b, plus_b, minus_b, start_b, stop_b, ENTRY, EXIT, INIT, TICK, ABSENT
}Signal;
/**
* @brief FSM states.
*/
typedef enum {
watch_showtime, watch_sethours, watch_setminutes, swatch_stop, swatch_running,
swatch_pause, alarm_sethours, alarm_setminutes, alarm_running, timer_sethours,
timer_setminutes, timer_setseconds, timer_running
}State;
CLASS(SWatchFSM)
State state_;
State swatchHistory_;
State alarmHistory_;
State timerHistory_;
METHODS
/**
* @}
*/
void SWatchFSMinit(SWatchFSM *me);
void SWatchFSMdispatch(SWatchFSM *me, Signal sig);
END_CLASS
#endif /* SWATCHFSM_H_ */