ソースを参照

can edit settings now

Thomas Buck 11ヶ月前
コミット
b2eeca99b9
14個のファイルの変更258行の追加72行の削除
  1. 1
    0
      CMakeLists.txt
  2. 3
    7
      include/config.h
  3. 0
    2
      include/menu.h
  4. 1
    0
      include/state.h
  5. 39
    0
      include/state_value.h
  6. 2
    0
      include/text.h
  7. 4
    0
      src/main.c
  8. 2
    24
      src/menu.c
  9. 6
    0
      src/state.c
  10. 1
    1
      src/state_about.c
  11. 6
    25
      src/state_scan.c
  12. 15
    0
      src/state_settings.c
  13. 169
    0
      src/state_value.c
  14. 9
    13
      src/state_workflow.c

+ 1
- 0
CMakeLists.txt ファイルの表示

@@ -92,6 +92,7 @@ target_sources(gadget PUBLIC
92 92
     src/workflow_default.c
93 93
     src/state_settings.c
94 94
     src/state_about.c
95
+    src/state_value.c
95 96
 
96 97
     ${CMAKE_CURRENT_BINARY_DIR}/fatfs/ff.c
97 98
     ${CMAKE_CURRENT_BINARY_DIR}/fatfs/ffunicode.c

+ 3
- 7
include/config.h ファイルの表示

@@ -25,18 +25,14 @@
25 25
 #define MENU_PREFER_VOLCANO
26 26
 //#define MENU_PREFER_CRAFTY
27 27
 
28
+#define VOLCANO_AUTO_CONNECT_TIMEOUT_MS 2000
29
+#define VOLCANO_AUTO_CONNECT_WITHIN_MS 10000
30
+
28 31
 #ifdef NDEBUG
29 32
 // Release build
30
-
31 33
 #define AUTO_MOUNT_MASS_STORAGE
32 34
 #define AUTO_LOG_ON_MASS_STORAGE
33 35
 #define DEBUG_DISK_WRITE_SOURCES
34
-
35
-#ifdef MENU_PREFER_VOLCANO
36
-#define VOLCANO_AUTO_CONNECT_TIMEOUT_MS 2000
37
-#define VOLCANO_AUTO_CONNECT_WITHIN_MS 10000
38
-#endif // MENU_PREFER_VOLCANO
39
-
40 36
 #endif // NDEBUG
41 37
 
42 38
 #define WATCHDOG_PERIOD_MS 1000

+ 0
- 2
include/menu.h ファイルの表示

@@ -39,9 +39,7 @@ void menu_deinit(void);
39 39
 
40 40
 void menu_run(void (*cb)(struct menu_state *), bool centered);
41 41
 
42
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
43 42
 extern bool menu_got_input;
44
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
45 43
 
46 44
 #define ADD_STATIC_ELEMENT(name) {\
47 45
     menu->length += 1; \

+ 1
- 0
include/state.h ファイルの表示

@@ -28,6 +28,7 @@ enum system_state {
28 28
     STATE_EDIT_WORKFLOW,
29 29
     STATE_SETTINGS,
30 30
     STATE_ABOUT,
31
+    STATE_VALUE,
31 32
 
32 33
     STATE_INVALID,
33 34
 };

+ 39
- 0
include/state_value.h ファイルの表示

@@ -0,0 +1,39 @@
1
+/*
2
+ * state_value.h
3
+ *
4
+ * Copyright (c) 2023 Thomas Buck (thomas@xythobuz.de)
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * See <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+#ifndef __STATE_VALUE_H__
20
+#define __STATE_VALUE_H__
21
+
22
+#include <sys/types.h>
23
+#include "state.h"
24
+
25
+enum value_step_mode {
26
+    VAL_STEP_INCREMENT = 0,
27
+    VAL_STEP_SHIFT,
28
+};
29
+
30
+void state_value_set(void *value, size_t length,
31
+                     ssize_t min, ssize_t max,
32
+                     enum value_step_mode mode, ssize_t step);
33
+void state_value_return(enum system_state state);
34
+
35
+void state_value_enter(void);
36
+void state_value_exit(void);
37
+void state_value_run(void);
38
+
39
+#endif // __STATE_VALUE_H__

+ 2
- 0
include/text.h ファイルの表示

@@ -20,8 +20,10 @@
20 20
 #define __TEXT_H__
21 21
 
22 22
 #include "mcufont.h"
23
+#include "menu.h"
23 24
 
24 25
 #define TEXT_BG_NONE -1
26
+#define TEXT_BOX_HEIGHT(font, space) ((MENU_MAX_LINES * font) + ((MENU_MAX_LINES - 1) * space))
25 27
 
26 28
 struct text_font {
27 29
     const char *fontname;

+ 4
- 0
src/main.c ファイルの表示

@@ -44,6 +44,10 @@ void main_loop_hw(void) {
44 44
     usb_run();
45 45
     serial_run();
46 46
     heartbeat_run();
47
+
48
+    if (lcd_get_backlight() != mem_data()->backlight) {
49
+        lcd_set_backlight(mem_data()->backlight);
50
+    }
47 51
 }
48 52
 
49 53
 int main(void) {

+ 2
- 24
src/menu.c ファイルの表示

@@ -22,7 +22,6 @@
22 22
 #include "buttons.h"
23 23
 #include "text.h"
24 24
 #include "lcd.h"
25
-#include "mem.h"
26 25
 #include "menu.h"
27 26
 
28 27
 static char prev_buff[MENU_MAX_LEN] = {0};
@@ -32,32 +31,12 @@ static void (*up_callback)(int) = NULL;
32 31
 static void (*down_callback)(int) = NULL;
33 32
 static void (*exit_callback)(void) = NULL;
34 33
 
35
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
36 34
 bool menu_got_input = false;
37
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
38 35
 
39 36
 static void menu_buttons(enum buttons btn, bool state) {
40
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
41 37
     menu_got_input = true;
42
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
43 38
 
44
-    if (state && (btn == BTN_LEFT)) {
45
-        uint16_t backlight_value = lcd_get_backlight();
46
-        if (backlight_value > 0x00FF) {
47
-            backlight_value = backlight_value >> 1;
48
-        }
49
-        lcd_set_backlight(backlight_value);
50
-        mem_data()->backlight = backlight_value;
51
-        return;
52
-    } else if (state && (btn == BTN_RIGHT)) {
53
-        uint16_t backlight_value = lcd_get_backlight();
54
-        if (backlight_value < 0xFF00) {
55
-            backlight_value = backlight_value << 1;
56
-        }
57
-        lcd_set_backlight(backlight_value);
58
-        mem_data()->backlight = backlight_value;
59
-        return;
60
-    } else if (state && ((btn == BTN_ENTER) || (btn == BTN_A))) {
39
+    if (state && ((btn == BTN_ENTER) || (btn == BTN_A))) {
61 40
         if (enter_callback) {
62 41
             enter_callback(menu.selection);
63 42
         }
@@ -127,7 +106,6 @@ void menu_init(void (*enter)(int),
127 106
 
128 107
 void menu_deinit(void) {
129 108
     buttons_callback(NULL);
130
-    mem_write();
131 109
 }
132 110
 
133 111
 void menu_run(void (*draw)(struct menu_state *), bool centered) {
@@ -140,7 +118,7 @@ void menu_run(void (*draw)(struct menu_state *), bool centered) {
140 118
         text_box(menu.buff, centered,
141 119
                  "fixed_10x20",
142 120
                  0, LCD_WIDTH,
143
-                 50, (MENU_MAX_LINES * 20) + ((MENU_MAX_LINES - 1) * 2),
121
+                 50, TEXT_BOX_HEIGHT(20, 2),
144 122
                  0);
145 123
     }
146 124
 }

+ 6
- 0
src/state.c ファイルの表示

@@ -25,6 +25,7 @@
25 25
 #include "state_edit_workflow.h"
26 26
 #include "state_settings.h"
27 27
 #include "state_about.h"
28
+#include "state_value.h"
28 29
 #include "state.h"
29 30
 
30 31
 #define stringify(name) # name
@@ -78,6 +79,11 @@ static const struct state states[STATE_INVALID + 1] = {
78 79
         .exit = state_about_exit,
79 80
         .run = state_about_run,
80 81
     }, {
82
+        .name = stringify(STATE_VALUE),
83
+        .enter = state_value_enter,
84
+        .exit = state_value_exit,
85
+        .run = state_value_run,
86
+    }, {
81 87
         .name = stringify(STATE_INVALID),
82 88
         .enter = NULL,
83 89
         .exit = NULL,

+ 1
- 1
src/state_about.c ファイルの表示

@@ -68,7 +68,7 @@ static const char *about_text =
68 68
 ;
69 69
 
70 70
 static const uint16_t step_size = 10;
71
-static const uint16_t max_height = (MENU_MAX_LINES * 20) + ((MENU_MAX_LINES - 1) * 2);
71
+static const uint16_t max_height = TEXT_BOX_HEIGHT(20, 2);
72 72
 
73 73
 static uint16_t off = 0;
74 74
 static bool held_up = false;

+ 6
- 25
src/state_scan.c ファイルの表示

@@ -24,6 +24,7 @@
24 24
 #include "config.h"
25 25
 #include "ble.h"
26 26
 #include "models.h"
27
+#include "mem.h"
27 28
 #include "menu.h"
28 29
 #include "state.h"
29 30
 #include "state_workflow.h"
@@ -33,11 +34,8 @@
33 34
 
34 35
 static struct ble_scan_result results[BLE_MAX_SCAN_RESULTS] = {0};
35 36
 static int result_count = 0;
36
-
37
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
38 37
 static uint32_t auto_connect_time = 0;
39 38
 static int auto_connect_idx = 0;
40
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
41 39
 
42 40
 static void enter_cb(int selection) {
43 41
     int devs = 0;
@@ -67,15 +65,8 @@ static void enter_cb(int selection) {
67 65
     }
68 66
 }
69 67
 
70
-static void edit_cb(int selection) {
71
-    UNUSED(selection);
72
-
73
-    state_wf_edit(true);
74
-    state_switch(STATE_WORKFLOW);
75
-}
76
-
77 68
 void state_scan_enter(void) {
78
-    menu_init(enter_cb, edit_cb, NULL, NULL);
69
+    menu_init(enter_cb, NULL, NULL, NULL);
79 70
     ble_scan(BLE_SCAN_ON);
80 71
 }
81 72
 
@@ -107,16 +98,12 @@ static void draw(struct menu_state *menu) {
107 98
             if (dev == DEV_VOLCANO) {
108 99
                 menu->selection = devs - 1;
109 100
 
110
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
111
-#ifdef VOLCANO_AUTO_CONNECT_WITHIN_MS
112 101
                 if (to_ms_since_boot(get_absolute_time()) <= VOLCANO_AUTO_CONNECT_WITHIN_MS) {
113
-#endif // VOLCANO_AUTO_CONNECT_WITHIN_MS
114
-                    auto_connect_time = to_ms_since_boot(get_absolute_time());
115
-                    auto_connect_idx = i;
116
-#ifdef VOLCANO_AUTO_CONNECT_WITHIN_MS
102
+                    if (mem_data()->wf_auto_connect) {
103
+                        auto_connect_time = to_ms_since_boot(get_absolute_time());
104
+                        auto_connect_idx = i;
105
+                    }
117 106
                 }
118
-#endif // VOLCANO_AUTO_CONNECT_WITHIN_MS
119
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
120 107
             }
121 108
 #endif // MENU_PREFER_VOLCANO
122 109
 #ifdef MENU_PREFER_CRAFTY
@@ -128,7 +115,6 @@ static void draw(struct menu_state *menu) {
128 115
 #endif // defined(MENU_PREFER_VOLCANO) || defined(MENU_PREFER_CRAFTY)
129 116
 
130 117
         if ((devs - 1) == menu->selection) {
131
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
132 118
             if ((auto_connect_time != 0) && (!menu_got_input)) {
133 119
                 uint32_t now = to_ms_since_boot(get_absolute_time());
134 120
                 uint32_t diff = now - auto_connect_time;
@@ -136,11 +122,8 @@ static void draw(struct menu_state *menu) {
136 122
                                 "%ld ",
137 123
                                 (VOLCANO_AUTO_CONNECT_TIMEOUT_MS / 1000) - (diff / 1000));
138 124
             } else {
139
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
140 125
                 pos += snprintf(menu->buff + pos, MENU_MAX_LEN - pos, "> ");
141
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
142 126
             }
143
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
144 127
         } else {
145 128
             pos += snprintf(menu->buff + pos, MENU_MAX_LEN - pos, "  ");
146 129
         }
@@ -174,7 +157,6 @@ static void draw(struct menu_state *menu) {
174 157
 void state_scan_run(void) {
175 158
     menu_run(draw, false);
176 159
 
177
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
178 160
     if ((auto_connect_time != 0) && (!menu_got_input)) {
179 161
         uint32_t now = to_ms_since_boot(get_absolute_time());
180 162
         if ((now - auto_connect_time) >= VOLCANO_AUTO_CONNECT_TIMEOUT_MS) {
@@ -186,5 +168,4 @@ void state_scan_run(void) {
186 168
             auto_connect_time = 0;
187 169
         }
188 170
     }
189
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
190 171
 }

+ 15
- 0
src/state_settings.c ファイルの表示

@@ -24,20 +24,34 @@
24 24
 #include "menu.h"
25 25
 #include "mem.h"
26 26
 #include "state.h"
27
+#include "state_value.h"
28
+#include "state_workflow.h"
27 29
 #include "state_settings.h"
28 30
 
29 31
 static void enter_cb(int selection) {
30 32
     switch (selection) {
31 33
     case 0:
32 34
         // Auto Connect
35
+        state_value_set(&mem_data()->wf_auto_connect,
36
+                        sizeof(mem_data()->wf_auto_connect),
37
+                        0, 1, VAL_STEP_INCREMENT, 1);
38
+        state_value_return(STATE_SETTINGS);
39
+        state_switch(STATE_VALUE);
33 40
         break;
34 41
 
35 42
     case 1:
36 43
         // Brightness
44
+        state_value_set(&mem_data()->backlight,
45
+                        sizeof(mem_data()->backlight),
46
+                        0x00FF, 0xFF00, VAL_STEP_SHIFT, 1);
47
+        state_value_return(STATE_SETTINGS);
48
+        state_switch(STATE_VALUE);
37 49
         break;
38 50
 
39 51
     case 2:
40 52
         // Workflows
53
+        state_wf_edit(true);
54
+        state_switch(STATE_WORKFLOW);
41 55
         break;
42 56
 
43 57
     case 3:
@@ -57,6 +71,7 @@ void state_settings_enter(void) {
57 71
 
58 72
 void state_settings_exit(void) {
59 73
     menu_deinit();
74
+    mem_write();
60 75
 }
61 76
 
62 77
 static void draw(struct menu_state *menu) {

+ 169
- 0
src/state_value.c ファイルの表示

@@ -0,0 +1,169 @@
1
+/*
2
+ * state_value.c
3
+ *
4
+ * Copyright (c) 2023 Thomas Buck (thomas@xythobuz.de)
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * See <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+#include <stdio.h>
20
+
21
+#include "config.h"
22
+#include "buttons.h"
23
+#include "log.h"
24
+#include "lcd.h"
25
+#include "text.h"
26
+#include "state_value.h"
27
+
28
+static void *val_p = NULL;
29
+static size_t val_len = 0;
30
+static ssize_t val_min = 0;
31
+static ssize_t val_max = 0;
32
+static ssize_t val_step = 0;
33
+
34
+static enum value_step_mode val_mode = VAL_STEP_INCREMENT;
35
+static enum system_state val_ret_state = STATE_SCAN;
36
+
37
+static ssize_t val = 0;
38
+
39
+void state_value_set(void *value, size_t length,
40
+                     ssize_t min, ssize_t max,
41
+                     enum value_step_mode mode, ssize_t step) {
42
+    val_p = value;
43
+    val_len = length;
44
+    val_min = min;
45
+    val_max = max;
46
+    val_mode = mode;
47
+    val_step = step;
48
+}
49
+
50
+void state_value_return(enum system_state state) {
51
+    val_ret_state = state;
52
+}
53
+
54
+static void draw(void) {
55
+    static char buff[100];
56
+    static size_t pos = 0;
57
+
58
+    if ((val_p == NULL) || (val_len <= 0)) {
59
+        pos += snprintf(buff, sizeof(buff),
60
+                        "error");
61
+    } else {
62
+        pos += snprintf(buff, sizeof(buff),
63
+                        "%d", val);
64
+    }
65
+
66
+    text_box(buff, false,
67
+             "fixed_10x20",
68
+             0, LCD_WIDTH,
69
+             50, TEXT_BOX_HEIGHT(20, 2),
70
+             0);
71
+}
72
+
73
+static void write(void) {
74
+    if ((val_p == NULL) || (val_len <= 0)) {
75
+        debug("invalid params");
76
+        return;
77
+    }
78
+
79
+    switch (val_len) {
80
+    case 1:
81
+        *((uint8_t *)val_p) = val;
82
+        break;
83
+
84
+    case 2:
85
+        *((uint16_t *)val_p) = val;
86
+        break;
87
+
88
+    case 4:
89
+        *((uint32_t *)val_p) = val;
90
+        break;
91
+
92
+    default:
93
+        debug("invalid len %d", val_len);
94
+        return;
95
+    }
96
+}
97
+
98
+static void step(ssize_t v) {
99
+    if ((val_p == NULL) || (val_len <= 0)) {
100
+        debug("invalid params");
101
+        return;
102
+    }
103
+
104
+    if (((v > 0) && (val >= val_max))
105
+        || ((v < 0) && (val <= val_min))) {
106
+        debug("val=%d v=%d", val, v);
107
+        return;
108
+    }
109
+
110
+    switch (val_mode) {
111
+    case VAL_STEP_INCREMENT:
112
+        val += v * val_step;
113
+        break;
114
+
115
+    case VAL_STEP_SHIFT:
116
+        if ((val_step * v) > 0) {
117
+            val <<= val_step;
118
+        } else {
119
+            val >>= val_step;
120
+        }
121
+        break;
122
+    }
123
+
124
+    // apply new value while editing
125
+    write();
126
+}
127
+
128
+static void value_buttons(enum buttons btn, bool state) {
129
+    if (state && (btn == BTN_Y)) {
130
+        state_switch(val_ret_state);
131
+    } else if (state && (btn == BTN_LEFT)) {
132
+        step(-1);
133
+        draw();
134
+    } else if (state && (btn == BTN_RIGHT)) {
135
+        step(1);
136
+        draw();
137
+    }
138
+}
139
+
140
+void state_value_enter(void) {
141
+    buttons_callback(value_buttons);
142
+
143
+    switch (val_len) {
144
+    case 1:
145
+        val = *((uint8_t *)val_p);
146
+        break;
147
+
148
+    case 2:
149
+        val = *((uint16_t *)val_p);
150
+        break;
151
+
152
+    case 4:
153
+        val = *((uint32_t *)val_p);
154
+        break;
155
+
156
+    default:
157
+        debug("invalid len %d", val_len);
158
+        return;
159
+    }
160
+
161
+    draw();
162
+}
163
+
164
+void state_value_exit(void) {
165
+    buttons_callback(NULL);
166
+    write();
167
+}
168
+
169
+void state_value_run(void) { }

+ 9
- 13
src/state_workflow.c ファイルの表示

@@ -22,6 +22,7 @@
22 22
 #include "pico/stdlib.h"
23 23
 
24 24
 #include "config.h"
25
+#include "mem.h"
25 26
 #include "menu.h"
26 27
 #include "workflow.h"
27 28
 #include "state.h"
@@ -30,10 +31,7 @@
30 31
 #include "state_workflow.h"
31 32
 
32 33
 static bool edit_mode = false;
33
-
34
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
35 34
 static uint32_t auto_connect_time = 0;
36
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
37 35
 
38 36
 static void enter_cb(int selection) {
39 37
     if ((selection >= 0) && (selection < wf_count())) {
@@ -68,7 +66,11 @@ static void upper_cb(int selection) {
68 66
 }
69 67
 
70 68
 static void exit_cb(void) {
71
-    state_switch(STATE_SCAN);
69
+    if (edit_mode) {
70
+        state_switch(STATE_SETTINGS);
71
+    } else {
72
+        state_switch(STATE_SCAN);
73
+    }
72 74
 }
73 75
 
74 76
 void state_wf_edit(bool edit) {
@@ -82,9 +84,9 @@ void state_wf_enter(void) {
82 84
         menu_init(enter_cb, NULL, NULL, exit_cb);
83 85
     }
84 86
 
85
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
86
-    auto_connect_time = to_ms_since_boot(get_absolute_time());
87
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
87
+    if (mem_data()->wf_auto_connect) {
88
+        auto_connect_time = to_ms_since_boot(get_absolute_time());
89
+    }
88 90
 }
89 91
 
90 92
 void state_wf_exit(void) {
@@ -102,7 +104,6 @@ static void draw(struct menu_state *menu) {
102 104
         }
103 105
 
104 106
         if (i == menu->selection) {
105
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
106 107
             if ((auto_connect_time != 0) && (!menu_got_input) && (!edit_mode)) {
107 108
                 uint32_t now = to_ms_since_boot(get_absolute_time());
108 109
                 uint32_t diff = now - auto_connect_time;
@@ -110,11 +111,8 @@ static void draw(struct menu_state *menu) {
110 111
                                 "%ld ",
111 112
                                 (VOLCANO_AUTO_CONNECT_TIMEOUT_MS / 1000) - (diff / 1000));
112 113
             } else {
113
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
114 114
                 pos += snprintf(menu->buff + pos, MENU_MAX_LEN - pos, "> ");
115
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
116 115
             }
117
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
118 116
         } else {
119 117
             pos += snprintf(menu->buff + pos, MENU_MAX_LEN - pos, "  ");
120 118
         }
@@ -135,7 +133,6 @@ static void draw(struct menu_state *menu) {
135 133
 void state_wf_run(void) {
136 134
     menu_run(draw, false);
137 135
 
138
-#ifdef VOLCANO_AUTO_CONNECT_TIMEOUT_MS
139 136
     if ((auto_connect_time != 0) && (!menu_got_input) && (!edit_mode)) {
140 137
         uint32_t now = to_ms_since_boot(get_absolute_time());
141 138
         if ((now - auto_connect_time) >= VOLCANO_AUTO_CONNECT_TIMEOUT_MS) {
@@ -146,5 +143,4 @@ void state_wf_run(void) {
146 143
             menu_got_input = true;
147 144
         }
148 145
     }
149
-#endif // VOLCANO_AUTO_CONNECT_TIMEOUT_MS
150 146
 }

読み込み中…
キャンセル
保存