Browse Source

volcano workflow disconnect

Thomas Buck 10 months ago
parent
commit
e421199617
1 changed files with 1 additions and 5 deletions
  1. 1
    5
      src/state_volcano_run.c

+ 1
- 5
src/state_volcano_run.c View File

35
 static bd_addr_type_t ble_type = 0;
35
 static bd_addr_type_t ble_type = 0;
36
 static bool wait_for_connect = false;
36
 static bool wait_for_connect = false;
37
 static bool wait_for_disconnect = false;
37
 static bool wait_for_disconnect = false;
38
-static bool aborted = false;
39
 
38
 
40
 void state_volcano_run_index(uint16_t index) {
39
 void state_volcano_run_index(uint16_t index) {
41
     wf_index = index;
40
     wf_index = index;
50
     if (state && (btn == BTN_Y)) {
49
     if (state && (btn == BTN_Y)) {
51
         if ((!wait_for_connect) && (!wait_for_disconnect)) {
50
         if ((!wait_for_connect) && (!wait_for_disconnect)) {
52
             debug("workflow abort");
51
             debug("workflow abort");
53
-            aborted = true;
54
             wf_reset();
52
             wf_reset();
55
             volcano_set_pump_state(false);
53
             volcano_set_pump_state(false);
56
             volcano_set_heater_state(false);
54
             volcano_set_heater_state(false);
67
     debug("workflow connect");
65
     debug("workflow connect");
68
     ble_connect(ble_addr, ble_type);
66
     ble_connect(ble_addr, ble_type);
69
     wait_for_connect = true;
67
     wait_for_connect = true;
70
-
71
-    aborted = false;
72
 }
68
 }
73
 
69
 
74
 void state_volcano_run_exit(void) {
70
 void state_volcano_run_exit(void) {
139
     menu_run(draw, true);
135
     menu_run(draw, true);
140
 
136
 
141
     // auto disconnect when end of workflow is reached
137
     // auto disconnect when end of workflow is reached
142
-    if ((!wait_for_connect) && (!aborted)) {
138
+    if ((!wait_for_connect) && (!wait_for_disconnect)) {
143
         struct wf_state state = wf_status();
139
         struct wf_state state = wf_status();
144
         if (state.status == WF_IDLE) {
140
         if (state.status == WF_IDLE) {
145
             debug("workflow disconnect");
141
             debug("workflow disconnect");

Loading…
Cancel
Save