Skip to content
Snippets Groups Projects
Commit d28e54d5 authored by kpd10's avatar kpd10
Browse files

Merge branch 'bluetooth_fix' into 'main'

updated state diagram

See merge request !2
parents 803a3a90 28f2619d
Branches main
No related tags found
1 merge request!2updated state diagram
Pipeline #459341 failed
out/state_diagram/State Diagram.png

70.8 KiB

......@@ -9,8 +9,8 @@ read -left-> run
run -down-> send : send button callback
send -up-> run
read -down-> stop : VBUS is connected
stop -up-> read : VBUS disconnected
read -down-> vbus : VBUS is connected
vbus -up-> read : VBUS disconnected
error -up-> init : sensor connected
state error {
......@@ -21,12 +21,13 @@ state error {
error_exit : turn off Error LED
}
state stop {
stop_entry -down-> stop_run
stop_run -up-> stop_exit
stop_entry : start Error LED timer
stop_run : wait for VBUS to be disconnected
stop_exit : stop Error LED timer
state vbus {
vbus_entry -down-> vbus_run
vbus_run -up-> vbus_exit
vbus_entry : start Error LED timer
vbus_run : wait for VBUS to be disconnected
vbus_exit : stop Error LED timer
vbus_exit : start checking for VBUS aain
}
state init {
......@@ -36,36 +37,42 @@ state init {
init_entry : Configure Interfaces
init_entry : Read device config from NVM
init_entry : Associate and initialize Callbacks
init_entry : initialize bluetooth
init_entry : check if sensor is connected
init_run : go to run state
init_exit : initialize pwm leds to be zero
init_exit : begin heartbeat LED
init_exit : begin VBUS checking timer
}
state run {
run_entry -> run_run
run_run -> run_exit
run_run : wait for save button event
run_run : wait for send button event
}
state read {
read_entry -> read_run
read_run -> read_exit
read_entry : check that VBUS is not connnected
read_entry : Read 100 Hz ADC in
read_entry : Read 500 Hz ADC in
read_entry : Read Pressure Info in
read_entry : Read Battery ADC in
read_entry : Reazd Pressure Info in
read_entry : Convert ADC values to mV
read_entry : Convert mV to corresponding brightness and pressure
read_entry : Turn on LEDs at appropriate brightness
read_entry : update array with pressure and LED brightness
read_run : wait for send button event
read_run : wait for arrays to be filled with data
read_run : Convert mV to corresponding brightness and pressure
read_run : Turn on LEDs at appropriate brightness
read_run : update array with pressure and LED brightness
read_run : go back to run state
read_exit : turn 100 Hz and 500 Hz LEDs off
}
state send {
send_entry -> send_run
send_run -> send_exit
send_entry : turn off LEDs
send_entry : Read Battery ADC in
send_run : format array for export
send_run : send array via Bluetooth to app
send_run : send battery level via Bluetooth to app
send_run : return to run state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment