Browse Source

MKS WiFi preliminary changes

Scott Lahteine 4 years ago
parent
commit
3893114c86
33 changed files with 132 additions and 156 deletions
  1. 3
    1
      Marlin/src/HAL/STM32F1/MarlinSerial.cpp
  2. 1
    1
      Marlin/src/MarlinCore.cpp
  3. 2
    2
      Marlin/src/gcode/feature/L6470/M916-918.cpp
  4. 1
    1
      Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
  5. 5
    8
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h
  6. 1
    5
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp
  7. 4
    5
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp
  8. 2
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp
  9. 7
    7
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp
  10. 14
    17
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp
  11. 2
    3
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp
  12. 2
    2
      Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp
  13. 3
    3
      Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp
  14. 2
    2
      Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp
  15. 3
    9
      Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp
  16. 1
    1
      Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp
  17. 3
    3
      Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp
  18. 15
    20
      Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp
  19. 3
    5
      Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h
  20. 2
    2
      Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp
  21. 2
    3
      Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp
  22. 6
    6
      Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp
  23. 2
    2
      Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp
  24. 2
    2
      Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp
  25. 1
    1
      Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp
  26. 1
    1
      Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp
  27. 27
    27
      Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h
  28. 1
    2
      Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp
  29. 1
    1
      Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h
  30. 2
    2
      Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp
  31. 2
    2
      Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp
  32. 4
    4
      Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h
  33. 5
    5
      Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp

+ 3
- 1
Marlin/src/HAL/STM32F1/MarlinSerial.cpp View File

@@ -111,7 +111,9 @@ constexpr bool serial_handles_emergency(int port) {
111 111
 // Instantiate all UARTs even if they are not needed
112 112
 // This avoids a bunch of logic to figure out every serial
113 113
 // port which may be in use on the system.
114
-DEFINE_HWSERIAL_MARLIN(MSerial1, 1);
114
+#if DISABLED(MKS_WIFI_MODULE)
115
+  DEFINE_HWSERIAL_MARLIN(MSerial1, 1);
116
+#endif
115 117
 DEFINE_HWSERIAL_MARLIN(MSerial2, 2);
116 118
 DEFINE_HWSERIAL_MARLIN(MSerial3, 3);
117 119
 #if EITHER(STM32_HIGH_DENSITY, STM32_XL_DENSITY)

+ 1
- 1
Marlin/src/MarlinCore.cpp View File

@@ -979,7 +979,7 @@ void setup() {
979 979
   #endif
980 980
   SERIAL_ECHO_MSG("start");
981 981
 
982
-  #if BOTH(HAS_TFT_LVGL_UI, USE_WIFI_FUNCTION)
982
+  #if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE)
983 983
     mks_esp_wifi_init();
984 984
     WIFISERIAL.begin(WIFI_BAUDRATE);
985 985
     serial_connect_timeout = millis() + 1000UL;

+ 2
- 2
Marlin/src/gcode/feature/L6470/M916-918.cpp View File

@@ -308,8 +308,8 @@ void GcodeSuite::M917() {
308 308
             L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
309 309
         }
310 310
         DEBUG_ECHOLNPGM(".");
311
-        gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered
312
-        watchdog_refresh();;   // beat the dog
311
+        gcode.reset_stepper_timeout(); // keep steppers powered
312
+        watchdog_refresh();
313 313
         safe_delay(5000);
314 314
         status_composite_temp = 0;
315 315
         for (j = 0; j < driver_count; j++) {

+ 1
- 1
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp View File

@@ -204,7 +204,7 @@ void TFTGLCD::print_line() {
204 204
   #endif
205 205
 }
206 206
 
207
-void TFTGLCD::print_screen(){
207
+void TFTGLCD::print_screen() {
208 208
   if (!PanelDetected) return;
209 209
   framebuffer[FBSIZE - 2] = picBits & PIC_MASK;
210 210
   framebuffer[FBSIZE - 1] = ledBits;

+ 5
- 8
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/dl_cache.h View File

@@ -29,15 +29,12 @@
29 29
  *
30 30
  * The DLCache can be used like so:
31 31
  *
32
- *   void some_function() {
33
- *     DLCache dlcache(UNIQUE_ID);
32
+ *   DLCache dlcache(UNIQUE_ID);
34 33
  *
35
- *     if (dlcache.hasData()) {
36
- *       dlcache.append();
37
- *     } else {
38
- *       // Add stuff to the DL
39
- *       dlcache.store();
40
- *     }
34
+ *   if (dlcache.hasData())
35
+ *     dlcache.append();
36
+ *   else
37
+ *     dlcache.store(); // Add stuff to the DL
41 38
  */
42 39
 class DLCache {
43 40
   private:

+ 1
- 5
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/tiny_timer.cpp View File

@@ -32,11 +32,7 @@ bool tiny_timer_t::elapsed(tiny_time_t duration) {
32 32
     #endif
33 33
   );
34 34
   uint8_t elapsed = now - _start;
35
-  if (elapsed >= duration._duration) {
36
-    return true;
37
-  } else {
38
-    return false;
39
-  }
35
+  return elapsed >= duration._duration;
40 36
 }
41 37
 
42 38
 void tiny_timer_t::start() {

+ 4
- 5
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_screen.cpp View File

@@ -78,9 +78,9 @@ void BedMeshScreen::drawMesh(int16_t x, int16_t y, int16_t w, int16_t h, ExtUI::
78 78
       }
79 79
     }
80 80
   }
81
-  if (val_cnt) {
81
+  if (val_cnt)
82 82
     val_mean /= val_cnt;
83
-  } else {
83
+  else {
84 84
     val_mean = 0;
85 85
     val_min  = 0;
86 86
     val_max  = 0;
@@ -327,11 +327,10 @@ void BedMeshScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::pr
327 327
       screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_NONE;
328 328
       break;
329 329
     case ExtUI::MESH_FINISH:
330
-      if (screen_data.BedMeshScreen.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray())) {
330
+      if (screen_data.BedMeshScreen.count == GRID_MAX_POINTS && isMeshComplete(ExtUI::getMeshArray()))
331 331
         screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_MESH_COMPLETE;
332
-      } else {
332
+      else
333 333
         screen_data.BedMeshScreen.message = screen_data.BedMeshScreen.MSG_MESH_INCOMPLETE;
334
-      }
335 334
       screen_data.BedMeshScreen.count = GRID_MAX_POINTS;
336 335
       break;
337 336
     case ExtUI::PROBE_START:

+ 2
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/boot_screen.cpp View File

@@ -72,7 +72,8 @@ void BootScreen::onIdle() {
72 72
     GOTO_SCREEN(TouchCalibrationScreen);
73 73
     current_screen.forget();
74 74
     PUSH_SCREEN(StatusScreen);
75
-  } else {
75
+  }
76
+  else {
76 77
     if (!UIFlashStorage::is_valid()) {
77 78
       StatusScreen::loadBitmaps();
78 79
       SpinnerDialogBox::show(GET_TEXT_F(MSG_PLEASE_WAIT));

+ 7
- 7
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/files_screen.cpp View File

@@ -152,11 +152,11 @@ void FilesScreen::drawFooter() {
152 152
   #undef MARGIN_T
153 153
   #undef MARGIN_B
154 154
   #ifdef TOUCH_UI_PORTRAIT
155
-  #define MARGIN_T 15
156
-  #define MARGIN_B 5
155
+    #define MARGIN_T 15
156
+    #define MARGIN_B 5
157 157
   #else
158
-  #define MARGIN_T 5
159
-  #define MARGIN_B 5
158
+    #define MARGIN_T 5
159
+    #define MARGIN_B 5
160 160
   #endif
161 161
   const bool    has_selection = screen_data.FilesScreen.selected_tag != 0xFF;
162 162
   const uint8_t back_tag      = screen_data.FilesScreen.flags.is_root ? 240 : 245;
@@ -170,11 +170,11 @@ void FilesScreen::drawFooter() {
170 170
      .tag(back_tag).button( BTN_POS(4,y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BACK))
171 171
      .enabled(has_selection)
172 172
      .colors(has_selection ? action_btn : normal_btn);
173
-  if (screen_data.FilesScreen.flags.is_dir) {
173
+
174
+  if (screen_data.FilesScreen.flags.is_dir)
174 175
     cmd.tag(244).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_OPEN));
175
-  } else {
176
+  else
176 177
     cmd.tag(243).button( BTN_POS(1, y), BTN_SIZE(3,h), GET_TEXT_F(MSG_BUTTON_PRINT));
177
-  }
178 178
 }
179 179
 
180 180
 void FilesScreen::onRedraw(draw_mode_t what) {

+ 14
- 17
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/lock_screen.cpp View File

@@ -122,28 +122,25 @@ char &LockScreen::message_style() {
122 122
 }
123 123
 
124 124
 void LockScreen::onPasscodeEntered() {
125
-  if (passcode == 0) {
126
-    // We are defining a passcode
125
+  if (passcode == 0) {                        // We are defining a passcode
127 126
     message_style() = 0;
128 127
     onRefresh();
129 128
     sound.play(twinkle, PLAY_SYNCHRONOUS);
130 129
     passcode = compute_checksum();
131 130
     GOTO_PREVIOUS();
132
-  } else {
133
-    // We are verifying a passcode
134
-    if (passcode == compute_checksum()) {
135
-      message_style() = 'g';
136
-      onRefresh();
137
-      sound.play(twinkle, PLAY_SYNCHRONOUS);
138
-      GOTO_PREVIOUS();
139
-    }
140
-    else {
141
-      message_style() = 'w';
142
-      onRefresh();
143
-      sound.play(sad_trombone, PLAY_SYNCHRONOUS);
144
-      current_screen.forget(); // Discard the screen the user was trying to go to.
145
-      GOTO_PREVIOUS();
146
-    }
131
+  }
132
+  else if (passcode == compute_checksum()) {  // We are verifying a passcode
133
+    message_style() = 'g';
134
+    onRefresh();
135
+    sound.play(twinkle, PLAY_SYNCHRONOUS);
136
+    GOTO_PREVIOUS();
137
+  }
138
+  else {
139
+    message_style() = 'w';
140
+    onRefresh();
141
+    sound.play(sad_trombone, PLAY_SYNCHRONOUS);
142
+    current_screen.forget(); // Discard the screen the user was trying to go to.
143
+    GOTO_PREVIOUS();
147 144
   }
148 145
 }
149 146
 

+ 2
- 3
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/save_settings_dialog_box.cpp View File

@@ -56,10 +56,9 @@ void SaveSettingsDialogBox::promptToSaveSettings() {
56 56
      // so SaveSettingsDialogBox doesn't return here.
57 57
      GOTO_SCREEN(SaveSettingsDialogBox);
58 58
      current_screen.forget();
59
-   } else {
60
-     // No save needed.
61
-     GOTO_PREVIOUS();
62 59
    }
60
+   else
61
+     GOTO_PREVIOUS(); // No save needed.
63 62
 }
64 63
 
65 64
 #endif // TOUCH_UI_FTDI_EVE

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_advance_settings.cpp View File

@@ -54,7 +54,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
54 54
       lv_clear_advance_settings();
55 55
       lv_draw_filament_settings();
56 56
       break;
57
-    #if ENABLED(USE_WIFI_FUNCTION)
57
+    #if ENABLED(MKS_WIFI_MODULE)
58 58
       case ID_WIFI_PARA:
59 59
       lv_clear_advance_settings();
60 60
       lv_draw_wifi_settings();
@@ -75,7 +75,7 @@ void lv_draw_advance_settings(void) {
75 75
   int index = 0;
76 76
   lv_screen_menu_item(scr, machine_menu.PausePosition, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_POS, index++);
77 77
   lv_screen_menu_item(scr, machine_menu.FilamentConf, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FILAMENT_SETTINGS, index++);
78
-  #if ENABLED(USE_WIFI_FUNCTION)
78
+  #if ENABLED(MKS_WIFI_MODULE)
79 79
     lv_screen_menu_item(scr, machine_menu.WifiSettings, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_WIFI_PARA, index++);
80 80
   #endif
81 81
   #if HAS_ROTARY_ENCODER

+ 3
- 3
Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp View File

@@ -239,7 +239,7 @@ void lv_draw_dialog(uint8_t type) {
239 239
     lv_obj_t *labelCancel = lv_label_create_empty(btnCancel);
240 240
     lv_label_set_text(labelCancel, print_file_dialog_menu.cancle);
241 241
   }
242
-  #if ENABLED(USE_WIFI_FUNCTION)
242
+  #if ENABLED(MKS_WIFI_MODULE)
243 243
     else if (DIALOG_IS(TYPE_UPLOAD_FILE)) {
244 244
       if (upload_result == 2) {
245 245
         btnCancel = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_cancel_event_cb);
@@ -377,7 +377,7 @@ void lv_draw_dialog(uint8_t type) {
377 377
     lv_label_set_text(labelDialog, DIALOG_UPDATE_NO_DEVICE_EN);
378 378
     lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);
379 379
   }
380
-  #if ENABLED(USE_WIFI_FUNCTION)
380
+  #if ENABLED(MKS_WIFI_MODULE)
381 381
     else if (DIALOG_IS(TYPE_UPLOAD_FILE)) {
382 382
       if (upload_result == 1) {
383 383
         lv_label_set_text(labelDialog, DIALOG_UPLOAD_ING_EN);
@@ -418,7 +418,7 @@ void lv_draw_dialog(uint8_t type) {
418 418
         lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);
419 419
       }
420 420
     }
421
-  #endif // USE_WIFI_FUNCTION
421
+  #endif // MKS_WIFI_MODULE
422 422
   else if (DIALOG_IS(TYPE_FILAMENT_LOAD_HEAT)) {
423 423
     lv_label_set_text(labelDialog, filament_menu.filament_dialog_load_heat);
424 424
     lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_keyboard.cpp View File

@@ -122,7 +122,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
122 122
       //if (res != LV_RES_OK) return;
123 123
       const char * ret_ta_txt = lv_ta_get_text(ext->ta);
124 124
       switch (keyboard_value) {
125
-        #if ENABLED(USE_WIFI_FUNCTION)
125
+        #if ENABLED(MKS_WIFI_MODULE)
126 126
           case wifiName:
127 127
             memcpy(uiCfg.wifi_name,ret_ta_txt,sizeof(uiCfg.wifi_name));
128 128
             lv_clear_keyboard();
@@ -158,7 +158,7 @@ static void lv_kb_event_cb(lv_obj_t *kb, lv_event_t event) {
158 158
             wifi_tips_type = TIPS_TYPE_JOINING;
159 159
             lv_draw_wifi_tips();
160 160
             break;
161
-        #endif // USE_WIFI_FUNCTION
161
+        #endif // MKS_WIFI_MODULE
162 162
         case gcodeCommand:
163 163
           uint8_t buf[100];
164 164
           strncpy((char *)buf,ret_ta_txt,sizeof(buf));

+ 3
- 9
Marlin/src/lcd/extui/lib/mks_ui/draw_operation.cpp View File

@@ -180,10 +180,7 @@ void lv_draw_operation(void) {
180 180
   label_PowerOff = lv_label_create_empty(buttonPowerOff);
181 181
 
182 182
   if (uiCfg.print_state != WORKING) {
183
-    /*
184
-      label_Filament = lv_label_create_empty(buttonFilament);
185
-    } else {
186
-    */
183
+    //label_Filament = lv_label_create_empty(buttonFilament);
187 184
     labelExtrusion = lv_label_create_empty(buttonExtrusion);
188 185
     label_Move = lv_label_create_empty(buttonMove);
189 186
   }
@@ -210,11 +207,8 @@ void lv_draw_operation(void) {
210 207
     lv_obj_align(label_PowerOff, buttonPowerOff, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
211 208
 
212 209
     if (uiCfg.print_state != WORKING) {
213
-      /*
214
-        lv_label_set_text(label_Filament, operation_menu.filament);
215
-        lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET);
216
-      } else {
217
-      */
210
+      //lv_label_set_text(label_Filament, operation_menu.filament);
211
+      //lv_obj_align(label_Filament, buttonFilament, LV_ALIGN_IN_BOTTOM_MID,0, BUTTON_TEXT_Y_OFFSET);
218 212
       lv_label_set_text(labelExtrusion, operation_menu.extr);
219 213
       lv_obj_align(labelExtrusion, buttonExtrusion, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
220 214
 

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/draw_ready_print.cpp View File

@@ -219,7 +219,7 @@ void lv_draw_ready_print(void) {
219 219
 
220 220
 void lv_clear_ready_print() {
221 221
   #if HAS_ROTARY_ENCODER
222
-    if (gCfgItems.encoder_enable == true) lv_group_remove_all_objs(g);
222
+    if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
223 223
   #endif
224 224
   lv_obj_del(scr);
225 225
 }

+ 3
- 3
Marlin/src/lcd/extui/lib/mks_ui/draw_set.cpp View File

@@ -54,7 +54,7 @@ enum {
54 54
 
55 55
 static void event_handler(lv_obj_t *obj, lv_event_t event) {
56 56
   if (event != LV_EVENT_RELEASED) return;
57
-  #if ENABLED(USE_WIFI_FUNCTION)
57
+  #if ENABLED(MKS_WIFI_MODULE)
58 58
     char buf[6] = { 0 };
59 59
   #endif
60 60
   switch (obj->mks_obj_id) {
@@ -87,7 +87,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
87 87
       lv_draw_ready_print();
88 88
       break;
89 89
 
90
-    #if ENABLED(USE_WIFI_FUNCTION)
90
+    #if ENABLED(MKS_WIFI_MODULE)
91 91
       case ID_S_WIFI:
92 92
         if (gCfgItems.wifi_mode_sel == STA_MODEL) {
93 93
           if (wifi_link_state == WIFI_CONNECTED) {
@@ -135,7 +135,7 @@ void lv_draw_set(void) {
135 135
   #if HAS_LANG_SELECT_SCREEN
136 136
     lv_big_button_create(scr, "F:/bmp_language.bin", set_menu.language, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_LANGUAGE);
137 137
   #endif
138
-  #if ENABLED(USE_WIFI_FUNCTION)
138
+  #if ENABLED(MKS_WIFI_MODULE)
139 139
     lv_big_button_create(scr, "F:/bmp_wifi.bin", set_menu.wifi, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_WIFI);
140 140
   #endif
141 141
   lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_S_RETURN);

+ 15
- 20
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp View File

@@ -138,7 +138,7 @@ void gCfgItems_init() {
138 138
   gCfgItems.levelingPos[4][0] = X_BED_SIZE / 2;
139 139
   gCfgItems.levelingPos[4][1] = Y_BED_SIZE / 2;
140 140
   gCfgItems.cloud_enable  = true;
141
-  #if ENABLED(USE_WIFI_FUNCTION)
141
+  #if ENABLED(MKS_WIFI_MODULE)
142 142
     gCfgItems.wifi_mode_sel = STA_MODEL;
143 143
     gCfgItems.fileSysType   = FILE_SYS_SD;
144 144
     gCfgItems.wifi_type     = ESP_WIFI;
@@ -203,7 +203,7 @@ void ui_cfg_init() {
203 203
   uiCfg.filament_unloading_time_flg  = 0;
204 204
   uiCfg.filament_unloading_time_cnt  = 0;
205 205
 
206
-  #if ENABLED(USE_WIFI_FUNCTION)
206
+  #if ENABLED(MKS_WIFI_MODULE)
207 207
     memset(&wifiPara, 0, sizeof(wifiPara));
208 208
     memset(&ipPara, 0, sizeof(ipPara));
209 209
     strcpy(wifiPara.ap_name, WIFI_AP_NAME);
@@ -542,7 +542,7 @@ char *getDispText(int index) {
542 542
       strcpy(public_buf_l, tool_menu.title);
543 543
       break;
544 544
     case WIFI_LIST_UI:
545
-      #if ENABLED(USE_WIFI_FUNCTION)
545
+      #if ENABLED(MKS_WIFI_MODULE)
546 546
         strcpy(public_buf_l, list_menu.title);
547 547
         break;
548 548
       #endif
@@ -1040,7 +1040,7 @@ void GUI_RefreshPage() {
1040 1040
       */
1041 1041
       break;
1042 1042
 
1043
-    #if ENABLED(USE_WIFI_FUNCTION)
1043
+    #if ENABLED(MKS_WIFI_MODULE)
1044 1044
       case WIFI_UI:
1045 1045
         if (temps_update_flag) {
1046 1046
           disp_wifi_state();
@@ -1061,7 +1061,7 @@ void GUI_RefreshPage() {
1061 1061
       break;
1062 1062
     case DIALOG_UI:
1063 1063
       filament_dialog_handle();
1064
-      TERN_(USE_WIFI_FUNCTION, wifi_scan_handle());
1064
+      TERN_(MKS_WIFI_MODULE, wifi_scan_handle());
1065 1065
       break;
1066 1066
     case MESHLEVELING_UI:
1067 1067
       /*disp_zpos();*/
@@ -1069,7 +1069,7 @@ void GUI_RefreshPage() {
1069 1069
     case HARDWARE_TEST_UI:
1070 1070
       break;
1071 1071
     case WIFI_LIST_UI:
1072
-      #if ENABLED(USE_WIFI_FUNCTION)
1072
+      #if ENABLED(MKS_WIFI_MODULE)
1073 1073
         if (printing_rate_update_flag) {
1074 1074
           disp_wifi_list();
1075 1075
           printing_rate_update_flag = false;
@@ -1080,7 +1080,7 @@ void GUI_RefreshPage() {
1080 1080
       /*update_password_disp();
1081 1081
       update_join_state_disp();*/
1082 1082
       break;
1083
-    #if ENABLED(USE_WIFI_FUNCTION)
1083
+    #if ENABLED(MKS_WIFI_MODULE)
1084 1084
       case WIFI_TIPS_UI:
1085 1085
         switch (wifi_tips_type) {
1086 1086
           case TIPS_TYPE_JOINING:
@@ -1216,11 +1216,11 @@ void clear_cur_ui() {
1216 1216
         case TMC_CURRENT_UI:          lv_clear_tmc_current_settings(); break;
1217 1217
       #endif
1218 1218
     case EEPROM_SETTINGS_UI:          lv_clear_eeprom_settings(); break;
1219
-      #if HAS_STEALTHCHOP
1220
-        case TMC_MODE_UI:             lv_clear_tmc_step_mode_settings(); break;
1221
-      #endif
1219
+    #if HAS_STEALTHCHOP
1220
+      case TMC_MODE_UI:               lv_clear_tmc_step_mode_settings(); break;
1221
+    #endif
1222 1222
     #if ENABLED(USE_WIFI_FUNCTION)
1223
-    case WIFI_SETTINGS_UI:            lv_clear_wifi_settings(); break;
1223
+      case WIFI_SETTINGS_UI:          lv_clear_wifi_settings(); break;
1224 1224
     #endif
1225 1225
     #if USE_SENSORLESS
1226 1226
       case HOMING_SENSITIVITY_UI:     lv_clear_homing_sensitivity_settings(); break;
@@ -1516,10 +1516,8 @@ lv_obj_t* lv_big_button_create(lv_obj_t *par, const char *img, const char *text,
1516 1516
     else
1517 1517
       lv_obj_align(label, btn, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
1518 1518
   }
1519
-  #if HAS_ROTARY_ENCODER
1520
-    if (gCfgItems.encoder_enable == true)
1521
-      lv_group_add_obj(g, btn);
1522
-  #endif
1519
+  if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable))
1520
+    lv_group_add_obj(g, btn);
1523 1521
   return btn;
1524 1522
 }
1525 1523
 
@@ -1535,11 +1533,8 @@ lv_obj_t* lv_screen_menu_item(lv_obj_t *par, const char *text, lv_coord_t x, lv_
1535 1533
     lv_label_set_text(label, text);
1536 1534
     lv_obj_align(label, btn, LV_ALIGN_IN_LEFT_MID, 0, 0);
1537 1535
   }
1538
-  #if HAS_ROTARY_ENCODER
1539
-    if (gCfgItems.encoder_enable == true) {
1540
-      lv_group_add_obj(g, btn);
1541
-    }
1542
-  #endif
1536
+  if (TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable))
1537
+    lv_group_add_obj(g, btn);
1543 1538
 
1544 1539
   if (drawArrow) (void)lv_imgbtn_create(par, "F:/bmp_arrow.bin", x + PARA_UI_SIZE_X, y + PARA_UI_ARROW_V, cb, id);
1545 1540
 

+ 3
- 5
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h View File

@@ -76,7 +76,7 @@
76 76
 #include "draw_keyboard.h"
77 77
 #include "draw_encoder_settings.h"
78 78
 
79
-#if ENABLED(USE_WIFI_FUNCTION)
79
+#if ENABLED(MKS_WIFI_MODULE)
80 80
   #include "wifiSerial.h"
81 81
   #include "wifi_module.h"
82 82
   #include "wifi_upload.h"
@@ -378,14 +378,12 @@ typedef enum {
378 378
   level_pos_x4,
379 379
   level_pos_y4,
380 380
   level_pos_x5,
381
-  level_pos_y5
381
+  level_pos_y5,
382 382
   #if HAS_BED_PROBE
383
-    ,
384 383
     x_offset,
385 384
     y_offset,
386
-    z_offset
385
+    z_offset,
387 386
   #endif
388
-  ,
389 387
   load_length,
390 388
   load_speed,
391 389
   unload_length,

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_wifi.cpp View File

@@ -26,7 +26,7 @@
26 26
 #include <lv_conf.h>
27 27
 #include "tft_lvgl_configuration.h"
28 28
 
29
-#if ENABLED(USE_WIFI_FUNCTION)
29
+#if ENABLED(MKS_WIFI_MODULE)
30 30
 
31 31
 #include "draw_ui.h"
32 32
 
@@ -159,5 +159,5 @@ void lv_clear_wifi() {
159 159
   lv_obj_del(scr);
160 160
 }
161 161
 
162
-#endif // USE_WIFI_FUNCTION
162
+#endif // MKS_WIFI_MODULE
163 163
 #endif // HAS_TFT_LVGL_UI

+ 2
- 3
Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_list.cpp View File

@@ -26,7 +26,7 @@
26 26
 #include <lv_conf.h>
27 27
 #include "tft_lvgl_configuration.h"
28 28
 
29
-#if ENABLED(USE_WIFI_FUNCTION)
29
+#if ENABLED(MKS_WIFI_MODULE)
30 30
 
31 31
 #include "draw_ui.h"
32 32
 
@@ -170,6 +170,5 @@ void lv_clear_wifi_list() {
170 170
   lv_obj_del(scr);
171 171
 }
172 172
 
173
-#endif // USE_WIFI_FUNCTION
174
-
173
+#endif // MKS_WIFI_MODULE
175 174
 #endif // HAS_TFT_LVGL_UI

+ 6
- 6
Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_settings.cpp View File

@@ -26,7 +26,7 @@
26 26
 #include <lv_conf.h>
27 27
 #include "tft_lvgl_configuration.h"
28 28
 
29
-#if ENABLED(USE_WIFI_FUNCTION)
29
+#if ENABLED(MKS_WIFI_MODULE)
30 30
 
31 31
 #include "draw_ui.h"
32 32
 
@@ -96,7 +96,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
96 96
 void lv_draw_wifi_settings(void) {
97 97
   scr = lv_screen_create(WIFI_SETTINGS_UI, machine_menu.WifiConfTitle);
98 98
 
99
-  lv_obj_t *labelModelText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode);
99
+  lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y + 10, machine_menu.wifiMode);
100 100
 
101 101
   lv_obj_t *buttonModelValue = lv_imgbtn_create(scr, "F:/bmp_blank_sel.bin", PARA_UI_VALUE_POS_X, PARA_UI_POS_Y + PARA_UI_VALUE_V, event_handler, ID_WIFI_MODEL);
102 102
   lv_btn_set_style_both(buttonModelValue, &style_para_value_pre);
@@ -119,7 +119,7 @@ void lv_draw_wifi_settings(void) {
119 119
   lv_obj_t *line3 = lv_line_create(scr, nullptr);
120 120
   lv_ex_line(line3, line_points[2]);
121 121
 
122
-  lv_obj_t *labelCloudText = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud);
122
+  lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 4 + 10, machine_menu.wifiCloud);
123 123
   lv_obj_t *buttonCloudValue = lv_imgbtn_create(scr, gCfgItems.cloud_enable ? "F:/bmp_enable.bin" : "F:/bmp_disable.bin", PARA_UI_STATE_POS_X, PARA_UI_POS_Y * 4 + PARA_UI_STATE_V, event_handler, ID_WIFI_CLOUD);
124 124
   labelCloudValue = lv_label_create_empty(buttonCloudValue);
125 125
 
@@ -141,14 +141,14 @@ void lv_draw_wifi_settings(void) {
141 141
       lv_label_set_text(labelModelValue, WIFI_STA_TEXT);
142 142
       lv_obj_align(labelModelValue, buttonModelValue, LV_ALIGN_CENTER, 0, 0);
143 143
     }
144
-    strcat(public_buf_m, machine_menu.wifiName);
144
+    strcpy(public_buf_m, machine_menu.wifiName);
145 145
     strcat(public_buf_m, (const char *)uiCfg.wifi_name);
146 146
     lv_label_set_text(labelNameText, public_buf_m);
147 147
 
148 148
     lv_label_set_text(labelNameValue, machine_menu.wifiEdit);
149 149
     lv_obj_align(labelNameValue, buttonNameValue, LV_ALIGN_CENTER, 0, 0);
150 150
 
151
-    strcat(public_buf_m, machine_menu.wifiPassWord);
151
+    strcpy(public_buf_m, machine_menu.wifiPassWord);
152 152
     strcat(public_buf_m, (const char *)uiCfg.wifi_key);
153 153
     lv_label_set_text(labelPassWordText, public_buf_m);
154 154
 
@@ -184,5 +184,5 @@ void lv_clear_wifi_settings() {
184 184
   lv_obj_del(scr);
185 185
 }
186 186
 
187
-#endif // USE_WIFI_FUNCTION
187
+#endif // MKS_WIFI_MODULE
188 188
 #endif // HAS_TFT_LVGL_UI

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_wifi_tips.cpp View File

@@ -26,7 +26,7 @@
26 26
 #include <lv_conf.h>
27 27
 #include "tft_lvgl_configuration.h"
28 28
 
29
-#if ENABLED(USE_WIFI_FUNCTION)
29
+#if ENABLED(MKS_WIFI_MODULE)
30 30
 
31 31
 #include "draw_ui.h"
32 32
 
@@ -64,5 +64,5 @@ void lv_draw_wifi_tips(void) {
64 64
 
65 65
 void lv_clear_wifi_tips() { lv_obj_del(scr); }
66 66
 
67
-#endif // USE_WIFI_FUNCTION
67
+#endif // MKS_WIFI_MODULE
68 68
 #endif // HAS_TFT_LVGL_UI

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/irq_overrid.cpp View File

@@ -25,7 +25,7 @@
25 25
 
26 26
 #include "tft_lvgl_configuration.h"
27 27
 
28
-#if ENABLED(USE_WIFI_FUNCTION)
28
+#if ENABLED(MKS_WIFI_MODULE)
29 29
 
30 30
 #include "draw_ui.h"
31 31
 #include "wifiSerial.h"
@@ -66,5 +66,5 @@ void __irq_usart1(void) {
66 66
   } /* C-declarations for C++ */
67 67
 #endif
68 68
 
69
-#endif // USE_WIFI_FUNCTION
69
+#endif // MKS_WIFI_MODULE
70 70
 #endif // HAS_TFT_LVGL_UI

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/pic_manager.cpp View File

@@ -205,7 +205,7 @@ static const char assets[][LONG_FILENAME_LENGTH] = {
205 205
   "bmp_enable.bin",
206 206
   "bmp_return.bin",
207 207
 
208
-  #if ENABLED(USE_WIFI_FUNCTION)
208
+  #if ENABLED(MKS_WIFI_MODULE)
209 209
     // wifi screen
210 210
     "bmp_wifi.bin",
211 211
   #endif

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp View File

@@ -148,7 +148,7 @@ void printer_state_polling() {
148 148
   if (uiCfg.print_state == WORKING)
149 149
     filament_check();
150 150
 
151
-  TERN_(USE_WIFI_FUNCTION, wifi_looping());
151
+  TERN_(MKS_WIFI_MODULE, wifi_looping());
152 152
 }
153 153
 
154 154
 void filament_pin_setup() {

+ 27
- 27
Marlin/src/lcd/extui/lib/mks_ui/tft_Language_en.h View File

@@ -48,7 +48,7 @@
48 48
 #define MACHINE_TYPE_CNOFIG_EN      "Machine settings"
49 49
 #define MOTOR_CONFIG_EN             "Motor settings"
50 50
 #define MACHINE_LEVELING_CONFIG_EN  "Leveling settings"
51
-#define ADVANCE_CONFIG_EN           "Adavance settings"
51
+#define ADVANCE_CONFIG_EN           "Advanced settings"
52 52
 
53 53
 #define MACHINE_CONFIG_TITLE_EN     "Machine Settings"
54 54
 #define MACHINE_TYPE_EN             "Machine type"
@@ -82,9 +82,9 @@
82 82
 #define MIN_ENDSTOP_X_EN                "X-axis minimum Endstop"
83 83
 #define MIN_ENDSTOP_Y_EN                "Y-axis minimum Endstop"
84 84
 #define MIN_ENDSTOP_Z_EN                "Z-axis minimum Endstop"
85
-#define MAX_ENDSTOP_X_EN                "X axis maximum Endstop"
86
-#define MAX_ENDSTOP_Y_EN                "Y axis maximum Endstop"
87
-#define MAX_ENDSTOP_Z_EN                "Z axis maximum Endstop"
85
+#define MAX_ENDSTOP_X_EN                "X-axis maximum Endstop"
86
+#define MAX_ENDSTOP_Y_EN                "Y-axis maximum Endstop"
87
+#define MAX_ENDSTOP_Z_EN                "Z-axis maximum Endstop"
88 88
 #define ENDSTOP_FIL_EN                  "Filament sensor"
89 89
 #define ENDSTOP_LEVEL_EN                "Leveling sensor"
90 90
 #define ENDSTOP_OPENED_EN               "Open"
@@ -107,11 +107,11 @@
107 107
 #define AUTO_LEVELING_ENABLE_EN         "Enable auto leveling"
108 108
 #define BLTOUCH_LEVELING_ENABLE_EN      "Enable BLtouch"
109 109
 #define PROBE_PORT_EN                   "Probe connector"
110
-#define PROBE_X_OFFSET_EN               "Probe x axis offset"
111
-#define PROBE_Y_OFFSET_EN               "Probe y axis offset"
112
-#define PROBE_Z_OFFSET_EN               "Probe z axis offset"
113
-#define PROBE_XY_SPEED_EN               "Probe xy axis speed"
114
-#define PROBE_Z_SPEED_EN                "Probe z axis speed"
110
+#define PROBE_X_OFFSET_EN               "Probe X-axis offset"
111
+#define PROBE_Y_OFFSET_EN               "Probe Y-axis offset"
112
+#define PROBE_Z_OFFSET_EN               "Probe Z-axis offset"
113
+#define PROBE_XY_SPEED_EN               "Probe XY-axis speed"
114
+#define PROBE_Z_SPEED_EN                "Probe Z-axis speed"
115 115
 #define ENABLE_EN                       "YES"
116 116
 #define DISABLE_EN                      "NO"
117 117
 #define Z_MIN_EN                        "ZMin"
@@ -162,11 +162,11 @@
162 162
 #define HOMEFEEDRATECONF_EN             "Home speed setting"
163 163
 
164 164
 #define MAXFEEDRATE_CONF_TITLE_EN       "Machine Settings>Maximum speed"
165
-#define X_MAXFEEDRATE_EN                "X axis maximum speed"
166
-#define Y_MAXFEEDRATE_EN                "Y axis maximum speed"
167
-#define Z_MAXFEEDRATE_EN                "Z axis maximum speed"
168
-#define E0_MAXFEEDRATE_EN               "E0 axis maximum speed"
169
-#define E1_MAXFEEDRATE_EN               "E1 axis maximum speed"
165
+#define X_MAXFEEDRATE_EN                "X-axis maximum speed"
166
+#define Y_MAXFEEDRATE_EN                "Y-axis maximum speed"
167
+#define Z_MAXFEEDRATE_EN                "Z-axis maximum speed"
168
+#define E0_MAXFEEDRATE_EN               "E0-axis maximum speed"
169
+#define E1_MAXFEEDRATE_EN               "E1-axis maximum speed"
170 170
 
171 171
 #define ACCELERATION_CONF_TITLE_EN      "Machine Settings>Acceleration"
172 172
 #define PRINT_ACCELERATION_EN           "Print acceleration"
@@ -192,18 +192,18 @@
192 192
 #define E1_STEPS_EN                     "E1-axis steps"
193 193
 
194 194
 #define TMC_CURRENT_CONF_TITLE_EN       "Machine Settings>TMC current settings"
195
-#define X_TMC_CURRENT_EN                "X axis current (mA)"
196
-#define Y_TMC_CURRENT_EN                "Y axis current (mA)"
197
-#define Z_TMC_CURRENT_EN                "Z axis current (mA)"
198
-#define E0_TMC_CURRENT_EN               "E0 axis current (mA)"
199
-#define E1_TMC_CURRENT_EN               "E1 axis current (mA)"
195
+#define X_TMC_CURRENT_EN                "X-axis current (mA)"
196
+#define Y_TMC_CURRENT_EN                "Y-axis current (mA)"
197
+#define Z_TMC_CURRENT_EN                "Z-axis current (mA)"
198
+#define E0_TMC_CURRENT_EN               "E0-axis current (mA)"
199
+#define E1_TMC_CURRENT_EN               "E1-axis current (mA)"
200 200
 
201 201
 #define TMC_MODE_CONF_TITLE_EN          "Machine Settings>TMC step mode settings"
202
-#define X_TMC_MODE_EN                   "Whether X axis enable stealthChop modes"
203
-#define Y_TMC_MODE_EN                   "Whether Y axis enable stealthChop modes"
204
-#define Z_TMC_MODE_EN                   "Whether Z axis enable stealthChop modes"
205
-#define E0_TMC_MODE_EN                  "Whether E0 axis enable stealthChop modes"
206
-#define E1_TMC_MODE_EN                  "Whether E1 axis enable stealthChop modes"
202
+#define X_TMC_MODE_EN                   "Whether X-axis enable stealthChop modes"
203
+#define Y_TMC_MODE_EN                   "Whether Y-axis enable stealthChop modes"
204
+#define Z_TMC_MODE_EN                   "Whether Z-axis enable stealthChop modes"
205
+#define E0_TMC_MODE_EN                  "Whether E0-axis enable stealthChop modes"
206
+#define E1_TMC_MODE_EN                  "Whether E1-axis enable stealthChop modes"
207 207
 
208 208
 #define MOTORDIR_CONF_TITLE_EN          "Machine Settings>Motor direction"
209 209
 #define X_MOTORDIR_EN                   "X-axis motor direction invert"
@@ -241,9 +241,9 @@
241 241
 #define E_ENABLE_PINS_INVERT_EN         "E_ENABLE_PIN_INVERT"
242 242
 
243 243
 #define PAUSE_POSITION_EN    "Printing pause position settings"
244
-#define PAUSE_POSITION_X_EN  "X axis position (Absolute position,-1 invalid)"
245
-#define PAUSE_POSITION_Y_EN  "Y axis position (Absolute position,-1 invalid)"
246
-#define PAUSE_POSITION_Z_EN  "Z axis position (Relative position,-1 invalid)"
244
+#define PAUSE_POSITION_X_EN  "X-axis position (Absolute position,-1 invalid)"
245
+#define PAUSE_POSITION_Y_EN  "Y-axis position (Absolute position,-1 invalid)"
246
+#define PAUSE_POSITION_Z_EN  "Z-axis position (Relative position,-1 invalid)"
247 247
 
248 248
 #define WIFI_SETTINGS_TITLE_EN    "Machine Settings>Wi-Fi Parameter"
249 249
 #define WIFI_SETTINGS_MODE_EN     "Wi-Fi Mode"

+ 1
- 2
Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp View File

@@ -84,7 +84,7 @@ uint8_t bmp_public_buf[17 * 1024];
84 84
 void SysTick_Callback() {
85 85
   lv_tick_inc(1);
86 86
   print_time_count();
87
-  #if ENABLED(USE_WIFI_FUNCTION)
87
+  #if ENABLED(MKS_WIFI_MODULE)
88 88
     if (tips_disp.timer == TIPS_TIMER_START)
89 89
       tips_disp.timer_count++;
90 90
   #endif
@@ -523,7 +523,6 @@ void lv_encoder_pin_init() {
523 523
         const uint8_t enc_c = (buttons & EN_C) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
524 524
         if (enc_c != last_button_state) {
525 525
           state = enc_c ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
526
-
527 526
           last_button_state = enc_c;
528 527
         }
529 528
 

+ 1
- 1
Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.h View File

@@ -33,7 +33,7 @@
33 33
 #include <lvgl.h>
34 34
 
35 35
 //#define TFT_ROTATION TFT_ROTATE_180
36
-#define USE_WIFI_FUNCTION 0
36
+#define MKS_WIFI_MODULE 0
37 37
 
38 38
 extern void tft_lvgl_init();
39 39
 extern void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p);

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/tft_multi_language.cpp View File

@@ -853,7 +853,7 @@ void disp_language_init() {
853 853
   machine_menu.key_point = KEYBOARD_KEY_POINT_EN;
854 854
   machine_menu.negative  = KEYBOARD_KEY_NEGATIVE_EN;
855 855
   // wifi-list
856
-  #if ENABLED(USE_WIFI_FUNCTION)
856
+  #if ENABLED(MKS_WIFI_MODULE)
857 857
     list_menu.title        = TEXT_WIFI_MENU_TITLE_EN;
858 858
     list_menu.file_pages   = FILE_PAGES_EN;
859 859
 
@@ -861,7 +861,7 @@ void disp_language_init() {
861 861
     tips_menu.joining      = TEXT_WIFI_JOINING_EN;
862 862
     tips_menu.failedJoin   = TEXT_WIFI_FAILED_JOIN_EN;
863 863
     tips_menu.wifiConected = TEXT_WIFI_WIFI_CONECTED_EN;
864
-  #endif  //USE_WIFI_FUNCTION
864
+  #endif  //MKS_WIFI_MODULE
865 865
   machine_setting_disp();
866 866
 
867 867
   operation_menu.babystep = TEXT_BABY_STEP_EN;

+ 2
- 2
Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.cpp View File

@@ -25,7 +25,7 @@
25 25
 
26 26
 #include "tft_lvgl_configuration.h"
27 27
 
28
-#if ENABLED(USE_WIFI_FUNCTION)
28
+#if ENABLED(MKS_WIFI_MODULE)
29 29
 
30 30
 #include "draw_ui.h"
31 31
 #include "wifiSerial.h"
@@ -118,5 +118,5 @@ int WifiSerial::wifi_rb_is_full(void) {
118 118
   return rb_is_full(this->usart_device->rb);
119 119
 }
120 120
 
121
-#endif // USE_WIFI_FUNCTION
121
+#endif // MKS_WIFI_MODULE
122 122
 #endif // HAS_TFT_LVGL_UI

+ 4
- 4
Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h View File

@@ -23,10 +23,10 @@
23 23
 
24 24
 #include "tft_lvgl_configuration.h"
25 25
 
26
-#if ENABLED(USE_WIFI_FUNCTION)
26
+#if ENABLED(MKS_WIFI_MODULE)
27 27
 
28
-#if SERIAL_PORT_2 != -1
29
-  #error "SERIAL_PORT_2 must be set to -1 with HAS_TFT_LVGL_UI and USE_WIFI_FUNCTION."
28
+#ifdef SERIAL_PORT_2
29
+  #error "SERIAL_PORT_2 must be disabled with HAS_TFT_LVGL_UI and MKS_WIFI_MODULE."
30 30
 #endif
31 31
 
32 32
 #define WIFI_BAUDRATE          115200
@@ -99,4 +99,4 @@ extern WifiSerial WifiSerial1;
99 99
 
100 100
 #define WIFISERIAL  WifiSerial1
101 101
 
102
-#endif // USE_WIFI_FUNCTION
102
+#endif // MKS_WIFI_MODULE

+ 5
- 5
Marlin/src/lcd/extui/lib/mks_ui/wifi_module.cpp View File

@@ -27,7 +27,7 @@
27 27
 #include "wifi_module.h"
28 28
 #include "wifi_upload.h"
29 29
 
30
-#if ENABLED(USE_WIFI_FUNCTION)
30
+#if ENABLED(MKS_WIFI_MODULE)
31 31
 
32 32
 #include "../../../../MarlinCore.h"
33 33
 #include "../../../../module/temperature.h"
@@ -283,7 +283,7 @@ void esp_port_begin(uint8_t interrupt) {
283 283
   }
284 284
   #endif
285 285
   if (interrupt) {
286
-    #if ENABLED(USE_WIFI_FUNCTION)
286
+    #if ENABLED(MKS_WIFI_MODULE)
287 287
       WIFISERIAL.end();
288 288
       for (uint16_t i = 0; i < 65535; i++);
289 289
       WIFISERIAL.begin(WIFI_BAUDRATE);
@@ -293,7 +293,7 @@ void esp_port_begin(uint8_t interrupt) {
293 293
     #endif
294 294
   }
295 295
   else {
296
-    #if ENABLED(USE_WIFI_FUNCTION)
296
+    #if ENABLED(MKS_WIFI_MODULE)
297 297
       WIFISERIAL.end();
298 298
       for (uint16_t i = 0; i < 65535; i++);
299 299
       WIFISERIAL.begin(WIFI_UPLOAD_BAUDRATE);
@@ -305,7 +305,7 @@ void esp_port_begin(uint8_t interrupt) {
305 305
   }
306 306
 }
307 307
 
308
-#if ENABLED(USE_WIFI_FUNCTION)
308
+#if ENABLED(MKS_WIFI_MODULE)
309 309
 
310 310
   int raw_send_to_wifi(char *buf, int len) {
311 311
     if (buf == 0 || len <= 0) return 0;
@@ -1811,5 +1811,5 @@ int readWifiBuf(int8_t *buf, int32_t len) {
1811 1811
   return i;
1812 1812
 }
1813 1813
 
1814
-#endif // USE_WIFI_FUNCTION
1814
+#endif // MKS_WIFI_MODULE
1815 1815
 #endif // HAS_TFT_LVGL_UI

Loading…
Cancel
Save