2 Commits

Author SHA1 Message Date
  Thomas Buck 471e4f99e1 battery limit color 1 year ago
  Thomas Buck e421199617 volcano workflow disconnect 1 year ago
2 changed files with 2 additions and 6 deletions
  1. 1
    1
      src/image.c
  2. 1
    5
      src/state_volcano_run.c

+ 1
- 1
src/image.c View File

90
 }
90
 }
91
 
91
 
92
 void draw_battery_indicator(void) {
92
 void draw_battery_indicator(void) {
93
-    static const float batt_warn_limit = 15.0f;
93
+    static const float batt_warn_limit = 0.0f;
94
     static char prev_s[30] = {0};
94
     static char prev_s[30] = {0};
95
     static uint32_t prev_c = 0;
95
     static uint32_t prev_c = 0;
96
 
96
 

+ 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