Browse Source

volcano workflow disconnect

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

Loading…
Cancel
Save