-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsm_with_actions.ceps
More file actions
100 lines (85 loc) · 1.71 KB
/
sm_with_actions.ceps
File metadata and controls
100 lines (85 loc) · 1.71 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
kind Event;
kind Systemstate;
kind Guard;
Event CAPS_LOCK,
ANY_KEY, OUT1, OUT2, OUT3;
Systemstate key_count;
Guard g,not_g;
g = key_count == 0;
not_g = !g;
sm{
basic_example1;
states{Initial;
default;
caps_locked;
Final;};
on_enter{
key_count = 10;
};
Actions{
send_lower_case_scan_code {
key_count = key_count - 1;
print("key_count=",key_count,"\n");
OUT1;
{
{
OUT2;
}
}
};
send_upper_case_scan_code{
key_count = key_count - 1;
print("key_count=",key_count,"\n");
OUT_3;
if(key_count == 3141592){
{
OUT3;
}
}
};
};
t{Initial; default;};
t{default; caps_locked; CAPS_LOCK;};
t{caps_locked; default; CAPS_LOCK;};
t{default;Final;ANY_KEY;g;};
t{caps_locked;Final;ANY_KEY;g;};
t{default; default; ANY_KEY;not_g; send_lower_case_scan_code;};
t{caps_locked; caps_locked; ANY_KEY;not_g; send_upper_case_scan_code;};
};
sm{
basic_example2;
states{Initial;
default;
caps_locked;
Final;};
on_enter{
key_count = 10;
};
Actions{
send_lower_case_scan_code {
key_count = key_count - 1;
print("key_count=",key_count,"\n");
{
{
OUT2;
}
}
};
send_upper_case_scan_code{
key_count = key_count - 1;
print("key_count=",key_count,"\n");
if(key_count == 3141592){
{
CAPS_LOCK;
}
}
};
};
t{Initial; default;};
t{default; caps_locked; OUT1;};
t{caps_locked; default; OUT2;};
t{default;Final;ANY_KEY;g;};
t{caps_locked;Final;ANY_KEY;g;};
t{default; default; ANY_KEY;not_g; send_lower_case_scan_code;};
t{caps_locked; caps_locked; ANY_KEY;not_g; send_upper_case_scan_code;};
};