66 lines
1.2 KiB
Plaintext
66 lines
1.2 KiB
Plaintext
@startuml
|
|
[*] --> F0 : reset/power-up
|
|
|
|
state "Blink frequency\nstates" as BlinkFreq {
|
|
state F0
|
|
state F10
|
|
state F20
|
|
state F30
|
|
state F40
|
|
state F50
|
|
}
|
|
|
|
' --- Notes ---
|
|
|
|
note right of F0
|
|
freq_idx = 0
|
|
f = 0 Hz (LED заморожен)
|
|
step_cnt считает до STEP_4SEC_MAX
|
|
end note
|
|
|
|
note right of F10
|
|
freq_idx = 1
|
|
f = 10 Hz
|
|
max_count = F_CLK/(2*10)-1
|
|
step_cnt считает до STEP_2SEC_MAX
|
|
end note
|
|
|
|
note right of F20
|
|
freq_idx = 2
|
|
f = 20 Hz
|
|
max_count = F_CLK/(2*20)-1
|
|
step_cnt считает до STEP_4SEC_MAX
|
|
end note
|
|
|
|
note right of F30
|
|
freq_idx = 3
|
|
f = 30 Hz
|
|
max_count = F_CLK/(2*30)-1
|
|
step_cnt считает до STEP_4SEC_MAX
|
|
end note
|
|
|
|
note right of F40
|
|
freq_idx = 4
|
|
f = 40 Hz
|
|
max_count = F_CLK/(2*40)-1
|
|
step_cnt считает до STEP_4SEC_MAX
|
|
end note
|
|
|
|
note right of F50
|
|
freq_idx = 5
|
|
f = 50 Hz
|
|
max_count = F_CLK/(2*50)-1
|
|
step_cnt считает до STEP_4SEC_MAX
|
|
end note
|
|
|
|
' --- Transitions ---
|
|
|
|
F0 --> F10 : step_cnt >= STEP_4SEC_MAX
|
|
F10 --> F20 : step_cnt >= STEP_2SEC_MAX
|
|
F20 --> F30 : step_cnt >= STEP_4SEC_MAX
|
|
F30 --> F40 : step_cnt >= STEP_4SEC_MAX
|
|
F40 --> F50 : step_cnt >= STEP_4SEC_MAX
|
|
F50 --> F0 : step_cnt >= STEP_4SEC_MAX
|
|
|
|
F0 --> [*] : external reset
|
|
@enduml |