Thomas Buck 6 mēnešus atpakaļ
vecāks
revīzija
9f0cd07d55
3 mainītis faili ar 18 papildinājumiem un 15 dzēšanām
  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 Parādīt failu

76
 }
76
 }
77
 
77
 
78
 static void exit_cb(void) {
78
 static void exit_cb(void) {
79
-    state_switch(STATE_SCAN);
79
+    state_switch(STATE_WORKFLOW);
80
 }
80
 }
81
 
81
 
82
 void state_edit_wf_index(uint16_t index) {
82
 void state_edit_wf_index(uint16_t index) {

+ 4
- 4
src/state_settings.c Parādīt failu

80
     int pos = 0;
80
     int pos = 0;
81
     menu->length = 0;
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
     if (menu->selection < 0) {
88
     if (menu->selection < 0) {
89
         menu->selection = 0;
89
         menu->selection = 0;

+ 13
- 10
src/state_volcano_conf.c Parādīt failu

37
 static bool val_disp_cool = false;
37
 static bool val_disp_cool = false;
38
 static uint16_t val_auto_shutoff = 0;
38
 static uint16_t val_auto_shutoff = 0;
39
 static uint8_t val_brightness = 0;
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
 static int32_t val_rt = 0;
41
 static int32_t val_rt = 0;
42
 
42
 
43
 void state_volcano_conf_target(bd_addr_t addr, bd_addr_type_t type) {
43
 void state_volcano_conf_target(bd_addr_t addr, bd_addr_type_t type) {
104
 
104
 
105
 static void send_values(void) {
105
 static void send_values(void) {
106
     volcano_set_unit(val_celsius ? UNIT_C : UNIT_F);
106
     volcano_set_unit(val_celsius ? UNIT_C : UNIT_F);
107
-    sleep_ms(150);
107
+    sleep_ms(250);
108
     volcano_set_vibration(val_vibrate);
108
     volcano_set_vibration(val_vibrate);
109
-    sleep_ms(150);
109
+    sleep_ms(250);
110
     volcano_set_display_cooling(val_disp_cool);
110
     volcano_set_display_cooling(val_disp_cool);
111
-    sleep_ms(150);
111
+    sleep_ms(250);
112
     volcano_set_auto_shutoff(val_auto_shutoff);
112
     volcano_set_auto_shutoff(val_auto_shutoff);
113
-    sleep_ms(150);
113
+    sleep_ms(250);
114
     volcano_set_brightness(val_brightness);
114
     volcano_set_brightness(val_brightness);
115
 }
115
 }
116
 
116
 
128
 
128
 
129
     val_auto_shutoff = volcano_get_auto_shutoff();
129
     val_auto_shutoff = volcano_get_auto_shutoff();
130
     val_brightness = volcano_get_brightness();
130
     val_brightness = volcano_get_brightness();
131
+
131
     volcano_get_firmware(val_fw);
132
     volcano_get_firmware(val_fw);
133
+    val_fw[VOLCANO_FW_LEN] = '\0';
134
+
132
     val_rt = volcano_get_runtime();
135
     val_rt = volcano_get_runtime();
133
 }
136
 }
134
 
137
 
169
     int pos = 0;
172
     int pos = 0;
170
     menu->length = 0;
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
     ADD_STATIC_ELEMENT("FW: %s", val_fw);
180
     ADD_STATIC_ELEMENT("FW: %s", val_fw);
178
     ADD_STATIC_ELEMENT("RT: %.1f h", val_rt / 60.0f);
181
     ADD_STATIC_ELEMENT("RT: %.1f h", val_rt / 60.0f);
179
 
182
 

Notiek ielāde…
Atcelt
Saglabāt