Browse Source

tweak settings

Thomas Buck 11 months ago
parent
commit
9f0cd07d55
3 changed files with 18 additions and 15 deletions
  1. 1
    1
      src/state_edit_workflow.c
  2. 4
    4
      src/state_settings.c
  3. 13
    10
      src/state_volcano_conf.c

+ 1
- 1
src/state_edit_workflow.c View File

@@ -76,7 +76,7 @@ static void upper_cb(int selection) {
76 76
 }
77 77
 
78 78
 static void exit_cb(void) {
79
-    state_switch(STATE_SCAN);
79
+    state_switch(STATE_WORKFLOW);
80 80
 }
81 81
 
82 82
 void state_edit_wf_index(uint16_t index) {

+ 4
- 4
src/state_settings.c View File

@@ -80,10 +80,10 @@ static void draw(struct menu_state *menu) {
80 80
     int pos = 0;
81 81
     menu->length = 0;
82 82
 
83
-    ADD_STATIC_ELEMENT("Auto Connect");
84
-    ADD_STATIC_ELEMENT("Brightness");
85
-    ADD_STATIC_ELEMENT("Workflows");
86
-    ADD_STATIC_ELEMENT("Reset");
83
+    ADD_STATIC_ELEMENT("Auto Connect (%d)", mem_data()->wf_auto_connect);
84
+    ADD_STATIC_ELEMENT("Brightness (%d)", __builtin_ffs(mem_data()->backlight));
85
+    ADD_STATIC_ELEMENT("Edit Workflows");
86
+    ADD_STATIC_ELEMENT("Factory Reset");
87 87
 
88 88
     if (menu->selection < 0) {
89 89
         menu->selection = 0;

+ 13
- 10
src/state_volcano_conf.c View File

@@ -37,7 +37,7 @@ static bool val_vibrate = false;
37 37
 static bool val_disp_cool = false;
38 38
 static uint16_t val_auto_shutoff = 0;
39 39
 static uint8_t val_brightness = 0;
40
-static char val_fw[VOLCANO_FW_LEN] = {0};
40
+static char val_fw[VOLCANO_FW_LEN + 1] = {0};
41 41
 static int32_t val_rt = 0;
42 42
 
43 43
 void state_volcano_conf_target(bd_addr_t addr, bd_addr_type_t type) {
@@ -104,13 +104,13 @@ static void enter_cb(int selection) {
104 104
 
105 105
 static void send_values(void) {
106 106
     volcano_set_unit(val_celsius ? UNIT_C : UNIT_F);
107
-    sleep_ms(150);
107
+    sleep_ms(250);
108 108
     volcano_set_vibration(val_vibrate);
109
-    sleep_ms(150);
109
+    sleep_ms(250);
110 110
     volcano_set_display_cooling(val_disp_cool);
111
-    sleep_ms(150);
111
+    sleep_ms(250);
112 112
     volcano_set_auto_shutoff(val_auto_shutoff);
113
-    sleep_ms(150);
113
+    sleep_ms(250);
114 114
     volcano_set_brightness(val_brightness);
115 115
 }
116 116
 
@@ -128,7 +128,10 @@ static void fetch_values(void) {
128 128
 
129 129
     val_auto_shutoff = volcano_get_auto_shutoff();
130 130
     val_brightness = volcano_get_brightness();
131
+
131 132
     volcano_get_firmware(val_fw);
133
+    val_fw[VOLCANO_FW_LEN] = '\0';
134
+
132 135
     val_rt = volcano_get_runtime();
133 136
 }
134 137
 
@@ -169,11 +172,11 @@ static void draw(struct menu_state *menu) {
169 172
     int pos = 0;
170 173
     menu->length = 0;
171 174
 
172
-    ADD_STATIC_ELEMENT("Celsius");
173
-    ADD_STATIC_ELEMENT("Vibrate");
174
-    ADD_STATIC_ELEMENT("Disp. Cool");
175
-    ADD_STATIC_ELEMENT("Auto Shutoff");
176
-    ADD_STATIC_ELEMENT("Brightness");
175
+    ADD_STATIC_ELEMENT("Celsius (%d)", val_celsius);
176
+    ADD_STATIC_ELEMENT("Vibrate (%d)", val_vibrate);
177
+    ADD_STATIC_ELEMENT("Disp. Cool (%d)", val_disp_cool);
178
+    ADD_STATIC_ELEMENT("Auto Shutoff (%d)", val_auto_shutoff / 60);
179
+    ADD_STATIC_ELEMENT("Brightness (%d)", val_brightness / 10);
177 180
     ADD_STATIC_ELEMENT("FW: %s", val_fw);
178 181
     ADD_STATIC_ELEMENT("RT: %.1f h", val_rt / 60.0f);
179 182
 

Loading…
Cancel
Save