Browse Source

LVGL UI G-code console (#20755)

X-Ryl669 3 years ago
parent
commit
c74f972627
No account linked to committer's email address

+ 2
- 2
Marlin/src/HAL/AVR/HAL.h View File

82
 
82
 
83
 // Serial ports
83
 // Serial ports
84
 #ifdef USBCON
84
 #ifdef USBCON
85
-  #include "../../core/serial_hook.h" 
85
+  #include "../../core/serial_hook.h"
86
   typedef ForwardSerial0Type< decltype(Serial) > DefaultSerial;
86
   typedef ForwardSerial0Type< decltype(Serial) > DefaultSerial;
87
   extern DefaultSerial MSerial;
87
   extern DefaultSerial MSerial;
88
   #ifdef BLUETOOTH
88
   #ifdef BLUETOOTH
89
     typedef ForwardSerial0Type< decltype(bluetoothSerial) > BTSerial;
89
     typedef ForwardSerial0Type< decltype(bluetoothSerial) > BTSerial;
90
     extern BTSerial btSerial;
90
     extern BTSerial btSerial;
91
   #endif
91
   #endif
92
-  
92
+
93
   #define MYSERIAL0 TERN(BLUETOOTH, btSerial, MSerial)
93
   #define MYSERIAL0 TERN(BLUETOOTH, btSerial, MSerial)
94
 #else
94
 #else
95
   #if !WITHIN(SERIAL_PORT, -1, 3)
95
   #if !WITHIN(SERIAL_PORT, -1, 3)

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

611
 
611
 
612
   template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
612
   template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
613
   MSerialT4 lcdSerial(MSerialT4::HasEmergencyParser);
613
   MSerialT4 lcdSerial(MSerialT4::HasEmergencyParser);
614
- 
614
+
615
   #if HAS_DGUS_LCD
615
   #if HAS_DGUS_LCD
616
     template<typename Cfg>
616
     template<typename Cfg>
617
     typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
617
     typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {

+ 4
- 4
Marlin/src/HAL/AVR/MarlinSerial.h View File

238
     static constexpr bool MAX_RX_QUEUED     = ENABLED(SERIAL_STATS_MAX_RX_QUEUED);
238
     static constexpr bool MAX_RX_QUEUED     = ENABLED(SERIAL_STATS_MAX_RX_QUEUED);
239
   };
239
   };
240
 
240
 
241
-  typedef Serial0Type< MarlinSerial< MarlinSerialCfg<SERIAL_PORT> > > MSerialT; 
241
+  typedef Serial0Type< MarlinSerial< MarlinSerialCfg<SERIAL_PORT> > > MSerialT;
242
   extern MSerialT customizedSerial1;
242
   extern MSerialT customizedSerial1;
243
 
243
 
244
   #ifdef SERIAL_PORT_2
244
   #ifdef SERIAL_PORT_2
245
-    typedef Serial0Type< MarlinSerial< MarlinSerialCfg<SERIAL_PORT_2> > > MSerialT2; 
245
+    typedef Serial0Type< MarlinSerial< MarlinSerialCfg<SERIAL_PORT_2> > > MSerialT2;
246
     extern MSerialT2 customizedSerial2;
246
     extern MSerialT2 customizedSerial2;
247
   #endif
247
   #endif
248
 
248
 
262
     static constexpr bool RX_OVERRUNS       = false;
262
     static constexpr bool RX_OVERRUNS       = false;
263
   };
263
   };
264
 
264
 
265
-  typedef Serial0Type< MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> > > MSerialT3; 
265
+  typedef Serial0Type< MarlinSerial< MMU2SerialCfg<MMU2_SERIAL_PORT> > > MSerialT3;
266
   extern MSerial3 mmuSerial;
266
   extern MSerial3 mmuSerial;
267
 #endif
267
 #endif
268
 
268
 
292
   };
292
   };
293
 
293
 
294
 
294
 
295
-  typedef Serial0Type< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialT4; 
295
+  typedef Serial0Type< MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> > > MSerialT4;
296
   extern MSerialT4 lcdSerial;
296
   extern MSerialT4 lcdSerial;
297
 #endif
297
 #endif
298
 
298
 

+ 1
- 1
Marlin/src/HAL/STM32/HAL.h View File

39
 
39
 
40
 #ifdef USBCON
40
 #ifdef USBCON
41
   #include <USBSerial.h>
41
   #include <USBSerial.h>
42
-  #include "../../core/serial_hook.h" 
42
+  #include "../../core/serial_hook.h"
43
   typedef ForwardSerial0Type< decltype(SerialUSB) > DefaultSerial;
43
   typedef ForwardSerial0Type< decltype(SerialUSB) > DefaultSerial;
44
   extern DefaultSerial MSerial;
44
   extern DefaultSerial MSerial;
45
 #endif
45
 #endif

+ 0
- 1
Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp View File

163
     GPIO_InitStruct.Pin = GPIO_PIN_2;
163
     GPIO_InitStruct.Pin = GPIO_PIN_2;
164
     HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
164
     HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
165
 
165
 
166
-
167
     #if DISABLED(STM32F1xx)
166
     #if DISABLED(STM32F1xx)
168
       // TODO: use __HAL_RCC_SDIO_RELEASE_RESET() and __HAL_RCC_SDIO_CLK_ENABLE();
167
       // TODO: use __HAL_RCC_SDIO_RELEASE_RESET() and __HAL_RCC_SDIO_CLK_ENABLE();
169
       RCC->APB2RSTR &= ~RCC_APB2RSTR_SDIORST_Msk;  // take SDIO out of reset
168
       RCC->APB2RSTR &= ~RCC_APB2RSTR_SDIORST_Msk;  // take SDIO out of reset

+ 26
- 0
Marlin/src/HAL/STM32F1/MarlinSerial.h View File

28
 #include "../../inc/MarlinConfigPre.h"
28
 #include "../../inc/MarlinConfigPre.h"
29
 #include "../../core/serial_hook.h"
29
 #include "../../core/serial_hook.h"
30
 
30
 
31
+#if HAS_TFT_LVGL_UI
32
+  extern "C" { extern char public_buf_m[100]; }
33
+#endif
34
+
31
 // Increase priority of serial interrupts, to reduce overflow errors
35
 // Increase priority of serial interrupts, to reduce overflow errors
32
 #define UART_IRQ_PRIO 1
36
 #define UART_IRQ_PRIO 1
33
 
37
 
45
       nvic_irq_set_priority(c_dev()->irq_num, UART_IRQ_PRIO);
49
       nvic_irq_set_priority(c_dev()->irq_num, UART_IRQ_PRIO);
46
     }
50
     }
47
   #endif
51
   #endif
52
+
53
+  #if HAS_TFT_LVGL_UI
54
+    // Hook the serial write method to capture the output of GCode command sent via LCD
55
+    uint32_t current_wpos;
56
+    void (*line_callback)(void *, const char * msg);
57
+    void *user_pointer;
58
+
59
+    void set_hook(void (*hook)(void *, const char *), void * that) { line_callback = hook; user_pointer = that; current_wpos = 0; }
60
+
61
+    size_t write(uint8_t c) {
62
+      if (line_callback) {
63
+        if (c == '\n' || current_wpos == sizeof(public_buf_m) - 1) { // End of line, probably end of command anyway
64
+          public_buf_m[current_wpos] = 0;
65
+          line_callback(user_pointer, public_buf_m);
66
+          current_wpos = 0;
67
+        }
68
+        else
69
+          public_buf_m[current_wpos++] = c;
70
+      }
71
+      return HardwareSerial::write(c);
72
+    }
73
+  #endif
48
 };
74
 };
49
 
75
 
50
 typedef Serial0Type<MarlinSerial> MSerialT;
76
 typedef Serial0Type<MarlinSerial> MSerialT;

+ 2
- 2
Marlin/src/core/macros.h View File

320
     template<bool, typename _Tp = void> struct enable_if { };
320
     template<bool, typename _Tp = void> struct enable_if { };
321
     template<typename _Tp>              struct enable_if<true, _Tp> { typedef _Tp type; };
321
     template<typename _Tp>              struct enable_if<true, _Tp> { typedef _Tp type; };
322
   }
322
   }
323
-  // C++11 solution using SFINAE to detect the existance of a member in a class at compile time. 
324
-  // It creates a HasMember<Type> structure containing 'value' set to true if the member exists  
323
+  // C++11 solution using SFINAE to detect the existance of a member in a class at compile time.
324
+  // It creates a HasMember<Type> structure containing 'value' set to true if the member exists
325
   #define HAS_MEMBER_IMPL(Member) \
325
   #define HAS_MEMBER_IMPL(Member) \
326
     namespace Private { \
326
     namespace Private { \
327
       template <typename Type, typename Yes=char, typename No=long> struct HasMember_ ## Member { \
327
       template <typename Type, typename Yes=char, typename No=long> struct HasMember_ ## Member { \

+ 4
- 3
Marlin/src/core/serial_hook.h View File

131
   using BaseClassT::print;
131
   using BaseClassT::print;
132
   using BaseClassT::println;
132
   using BaseClassT::println;
133
 
133
 
134
+
134
   // Underlying implementation might use Arduino's bool operator
135
   // Underlying implementation might use Arduino's bool operator
135
-  bool connected() { 
136
-    return Private::HasMember_connected<SerialT>::value ? CALL_IF_EXISTS(bool, static_cast<SerialT*>(this), connected) : static_cast<SerialT*>(this)->operator bool(); 
137
-  }  
136
+  bool connected() {
137
+    return Private::HasMember_connected<SerialT>::value ? CALL_IF_EXISTS(bool, static_cast<SerialT*>(this), connected) : static_cast<SerialT*>(this)->operator bool();
138
+  }
138
 
139
 
139
   void setHook(WriteHook writeHook = 0, EndOfMessageHook eofHook = 0, void * userPointer = 0) {
140
   void setHook(WriteHook writeHook = 0, EndOfMessageHook eofHook = 0, void * userPointer = 0) {
140
     // Order is important here as serial code can be called inside interrupts
141
     // Order is important here as serial code can be called inside interrupts

+ 109
- 0
Marlin/src/lcd/extui/lib/mks_ui/draw_gcode.cpp View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#include "../../../../inc/MarlinConfigPre.h"
23
+
24
+#if HAS_TFT_LVGL_UI
25
+
26
+#include "draw_ui.h"
27
+#include <lv_conf.h>
28
+
29
+#include "../../../../inc/MarlinConfig.h"
30
+
31
+extern lv_group_t *g;
32
+static lv_obj_t *scr,*outL,*outV = 0;
33
+static int currentWritePos = 0;
34
+extern uint8_t public_buf[513];
35
+extern "C" { extern char public_buf_m[100]; }
36
+
37
+enum {
38
+  ID_GCODE_RETURN = 1,
39
+  ID_GCODE_COMMAND,
40
+};
41
+
42
+static void event_handler(lv_obj_t *obj, lv_event_t event) {
43
+  if (event != LV_EVENT_RELEASED) return;
44
+  lv_clear_gcode();
45
+  switch (obj->mks_obj_id) {
46
+    case ID_GCODE_RETURN:
47
+      lv_draw_more();
48
+      return;
49
+    case ID_GCODE_COMMAND:
50
+      keyboard_value = GCodeCommand;
51
+      lv_draw_keyboard();
52
+      break;
53
+  }
54
+}
55
+
56
+void lv_show_gcode_output(void * that, const char * txt) {
57
+  // Ignore echo of command
58
+  if (!memcmp(txt, "echo:", 5)) {
59
+    public_buf[0] = 0; // Clear output buffer
60
+    return;
61
+   }
62
+
63
+  // Avoid overflow if the answer is too large
64
+  size_t len = strlen((const char*)public_buf), tlen = strlen(txt);
65
+  if (len + tlen + 1 < sizeof(public_buf)) {
66
+    memcpy(public_buf + len, txt, tlen);
67
+    public_buf[len + tlen] = '\n';
68
+  }
69
+}
70
+
71
+void lv_serial_capt_hook(void * userPointer, uint8_t c)
72
+{
73
+  if (c == '\n' || currentWritePos == sizeof(public_buf_m) - 1) { // End of line, probably end of command anyway
74
+    public_buf_m[currentWritePos] = 0;
75
+    lv_show_gcode_output(userPointer, public_buf_m);
76
+    currentWritePos = 0;
77
+  }
78
+  else public_buf_m[currentWritePos++] = c;
79
+}
80
+void lv_eom_hook(void *)
81
+{
82
+  // Message is done, let's remove the hook now
83
+  MYSERIAL0.setHook();
84
+  // We are back from the keyboard, so let's redraw ourselves
85
+  draw_return_ui();
86
+}
87
+
88
+void lv_draw_gcode(bool clear) {
89
+  if (clear) {
90
+    currentWritePos = 0;
91
+    public_buf[0] = 0;
92
+  }
93
+  scr = lv_screen_create(GCODE_UI, more_menu.gcode);
94
+  lv_screen_menu_item(scr, more_menu.entergcode, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_GCODE_COMMAND, 1);
95
+  outL = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 2, "Result:");
96
+  outV = lv_label_create(scr, PARA_UI_POS_X, PARA_UI_POS_Y * 3, (const char*)public_buf);
97
+
98
+  lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X + 10, PARA_UI_BACL_POS_Y, event_handler, ID_GCODE_RETURN, true);
99
+}
100
+
101
+void lv_clear_gcode() {
102
+  #if HAS_ROTARY_ENCODER
103
+    if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
104
+  #endif
105
+  lv_obj_del(scr);
106
+  outV = 0;
107
+}
108
+
109
+#endif // HAS_TFT_LVGL_UI

+ 33
- 0
Marlin/src/lcd/extui/lib/mks_ui/draw_gcode.h View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#ifdef __cplusplus
25
+  extern "C" { /* C-declarations for C++ */
26
+#endif
27
+
28
+extern void lv_draw_gcode(bool clear = false);
29
+extern void lv_clear_gcode();
30
+
31
+#ifdef __cplusplus
32
+  } /* C-declarations for C++ */
33
+#endif

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

27
 #include <lv_conf.h>
27
 #include <lv_conf.h>
28
 
28
 
29
 #include "../../../../inc/MarlinConfig.h"
29
 #include "../../../../inc/MarlinConfig.h"
30
+#include "../../../../gcode/queue.h"
30
 
31
 
31
 extern lv_group_t *g;
32
 extern lv_group_t *g;
32
 static lv_obj_t *scr;
33
 static lv_obj_t *scr;
153
             lv_draw_wifi_tips();
154
             lv_draw_wifi_tips();
154
             break;
155
             break;
155
         #endif // MKS_WIFI_MODULE
156
         #endif // MKS_WIFI_MODULE
156
-        case gcodeCommand:
157
+        case autoLevelGcodeCommand:
157
           uint8_t buf[100];
158
           uint8_t buf[100];
158
           strncpy((char *)buf,ret_ta_txt,sizeof(buf));
159
           strncpy((char *)buf,ret_ta_txt,sizeof(buf));
159
           update_gcode_command(AUTO_LEVELING_COMMAND_ADDR,buf);
160
           update_gcode_command(AUTO_LEVELING_COMMAND_ADDR,buf);
160
           lv_clear_keyboard();
161
           lv_clear_keyboard();
161
           draw_return_ui();
162
           draw_return_ui();
162
           break;
163
           break;
164
+        case GCodeCommand:
165
+          if (queue.length <= (BUFSIZE - 3)) {
166
+            // Hook anything that goes to the serial port
167
+            MYSERIAL0.setHook(lv_serial_capt_hook, lv_eom_hook, 0);
168
+            queue.enqueue_one_now(ret_ta_txt);
169
+          }
170
+          lv_clear_keyboard();
171
+          // draw_return_ui is called in the end of message hook
172
+          break;
163
         default: break;
173
         default: break;
164
       }
174
       }
165
     }
175
     }
238
   // Create a text area. The keyboard will write here
248
   // Create a text area. The keyboard will write here
239
   lv_obj_t *ta = lv_ta_create(scr, nullptr);
249
   lv_obj_t *ta = lv_ta_create(scr, nullptr);
240
   lv_obj_align(ta, nullptr, LV_ALIGN_IN_TOP_MID, 0, 10);
250
   lv_obj_align(ta, nullptr, LV_ALIGN_IN_TOP_MID, 0, 10);
241
-  if (keyboard_value == gcodeCommand) {
251
+  switch (keyboard_value) {
252
+    case autoLevelGcodeCommand:
242
     get_gcode_command(AUTO_LEVELING_COMMAND_ADDR,(uint8_t *)public_buf_m);
253
     get_gcode_command(AUTO_LEVELING_COMMAND_ADDR,(uint8_t *)public_buf_m);
243
     public_buf_m[sizeof(public_buf_m)-1] = 0;
254
     public_buf_m[sizeof(public_buf_m)-1] = 0;
244
     lv_ta_set_text(ta, public_buf_m);
255
     lv_ta_set_text(ta, public_buf_m);
245
-  }
246
-  else {
256
+      break;
257
+    case GCodeCommand:
258
+      // Start with uppercase by default
259
+      lv_btnm_set_map(kb, kb_map_uc);
260
+      lv_btnm_set_ctrl_map(kb, kb_ctrl_uc_map);
261
+      // Fallthrough
262
+    default:
247
     lv_ta_set_text(ta, "");
263
     lv_ta_set_text(ta, "");
248
   }
264
   }
249
 
265
 

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

49
       lv_draw_manual_level_pos_settings();
49
       lv_draw_manual_level_pos_settings();
50
       break;
50
       break;
51
     case ID_LEVEL_COMMAND:
51
     case ID_LEVEL_COMMAND:
52
-      keyboard_value = gcodeCommand;
52
+      keyboard_value = autoLevelGcodeCommand;
53
       lv_draw_keyboard();
53
       lv_draw_keyboard();
54
       break;
54
       break;
55
     #if HAS_BED_PROBE
55
     #if HAS_BED_PROBE

+ 15
- 19
Marlin/src/lcd/extui/lib/mks_ui/draw_more.cpp View File

41
   ID_CUSTOM_4,
41
   ID_CUSTOM_4,
42
   ID_CUSTOM_5,
42
   ID_CUSTOM_5,
43
   ID_CUSTOM_6,
43
   ID_CUSTOM_6,
44
-  ID_CUSTOM_7,
45
   ID_M_RETURN,
44
   ID_M_RETURN,
46
 };
45
 };
47
 
46
 
48
 static void event_handler(lv_obj_t * obj, lv_event_t event) {
47
 static void event_handler(lv_obj_t * obj, lv_event_t event) {
49
   if (event != LV_EVENT_RELEASED) return;
48
   if (event != LV_EVENT_RELEASED) return;
50
   switch (obj->mks_obj_id) {
49
   switch (obj->mks_obj_id) {
50
+    case ID_GCODE: lv_clear_more(); lv_draw_gcode(true); break;
51
     case ID_CUSTOM_1: TERN_(USER_CMD_1_ENABLE, queue.inject_P(PSTR(USER_GCODE_1))); break;
51
     case ID_CUSTOM_1: TERN_(USER_CMD_1_ENABLE, queue.inject_P(PSTR(USER_GCODE_1))); break;
52
     case ID_CUSTOM_2: TERN_(USER_CMD_2_ENABLE, queue.inject_P(PSTR(USER_GCODE_2))); break;
52
     case ID_CUSTOM_2: TERN_(USER_CMD_2_ENABLE, queue.inject_P(PSTR(USER_GCODE_2))); break;
53
     case ID_CUSTOM_3: TERN_(USER_CMD_3_ENABLE, queue.inject_P(PSTR(USER_GCODE_3))); break;
53
     case ID_CUSTOM_3: TERN_(USER_CMD_3_ENABLE, queue.inject_P(PSTR(USER_GCODE_3))); break;
54
     case ID_CUSTOM_4: TERN_(USER_CMD_4_ENABLE, queue.inject_P(PSTR(USER_GCODE_4))); break;
54
     case ID_CUSTOM_4: TERN_(USER_CMD_4_ENABLE, queue.inject_P(PSTR(USER_GCODE_4))); break;
55
     case ID_CUSTOM_5: TERN_(USER_CMD_5_ENABLE, queue.inject_P(PSTR(USER_GCODE_5))); break;
55
     case ID_CUSTOM_5: TERN_(USER_CMD_5_ENABLE, queue.inject_P(PSTR(USER_GCODE_5))); break;
56
     case ID_CUSTOM_6: TERN_(USER_CMD_6_ENABLE, queue.inject_P(PSTR(USER_GCODE_6))); break;
56
     case ID_CUSTOM_6: TERN_(USER_CMD_6_ENABLE, queue.inject_P(PSTR(USER_GCODE_6))); break;
57
-    case ID_CUSTOM_7: TERN_(USER_CMD_7_ENABLE, queue.inject_P(PSTR(USER_GCODE_7))); break;
58
     case ID_M_RETURN:
57
     case ID_M_RETURN:
59
       lv_clear_more();
58
       lv_clear_more();
60
       lv_draw_tool();
59
       lv_draw_tool();
67
 
66
 
68
   const bool enc_ena = TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable);
67
   const bool enc_ena = TERN0(HAS_ROTARY_ENCODER, gCfgItems.encoder_enable);
69
 
68
 
69
+  lv_obj_t *buttonGCode = lv_imgbtn_create(scr, "F:/bmp_machine_para.bin", INTERVAL_V, titleHeight, event_handler, ID_GCODE);
70
+  if (enc_ena) lv_group_add_obj(g, buttonGCode);
71
+  lv_obj_t *labelGCode = lv_label_create_empty(buttonGCode);
72
+
70
   #if ENABLED(USER_CMD_1_ENABLE)
73
   #if ENABLED(USER_CMD_1_ENABLE)
71
-    lv_obj_t *buttonCustom1 = lv_imgbtn_create(scr, "F:/bmp_custom1.bin", INTERVAL_V, titleHeight, event_handler, ID_CUSTOM_1);
74
+    lv_obj_t *buttonCustom1 = lv_imgbtn_create(scr, "F:/bmp_custom1.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_CUSTOM_1);
72
     if (enc_ena) lv_group_add_obj(g, buttonCustom1);
75
     if (enc_ena) lv_group_add_obj(g, buttonCustom1);
73
     lv_obj_t *labelCustom1 = lv_label_create_empty(buttonCustom1);
76
     lv_obj_t *labelCustom1 = lv_label_create_empty(buttonCustom1);
74
   #endif
77
   #endif
75
 
78
 
76
   #if ENABLED(USER_CMD_2_ENABLE)
79
   #if ENABLED(USER_CMD_2_ENABLE)
77
-    lv_obj_t *buttonCustom2 = lv_imgbtn_create(scr, "F:/bmp_custom2.bin", BTN_X_PIXEL + INTERVAL_V * 2, titleHeight, event_handler, ID_CUSTOM_2);
80
+    lv_obj_t *buttonCustom2 = lv_imgbtn_create(scr, "F:/bmp_custom2.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_CUSTOM_2);
78
     if (enc_ena) lv_group_add_obj(g, buttonCustom2);
81
     if (enc_ena) lv_group_add_obj(g, buttonCustom2);
79
     lv_obj_t *labelCustom2 = lv_label_create_empty(buttonCustom2);
82
     lv_obj_t *labelCustom2 = lv_label_create_empty(buttonCustom2);
80
   #endif
83
   #endif
81
 
84
 
82
   #if ENABLED(USER_CMD_3_ENABLE)
85
   #if ENABLED(USER_CMD_3_ENABLE)
83
-    lv_obj_t *buttonCustom3 = lv_imgbtn_create(scr, "F:/bmp_custom3.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, titleHeight, event_handler, ID_CUSTOM_3);
86
+    lv_obj_t *buttonCustom3 = lv_imgbtn_create(scr, "F:/bmp_custom3.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_CUSTOM_3);
84
     if (enc_ena) lv_group_add_obj(g, buttonCustom3);
87
     if (enc_ena) lv_group_add_obj(g, buttonCustom3);
85
     lv_obj_t *labelCustom3 = lv_label_create_empty(buttonCustom3);
88
     lv_obj_t *labelCustom3 = lv_label_create_empty(buttonCustom3);
86
   #endif
89
   #endif
87
 
90
 
88
   #if ENABLED(USER_CMD_4_ENABLE)
91
   #if ENABLED(USER_CMD_4_ENABLE)
89
-    lv_obj_t *buttonCustom4 = lv_imgbtn_create(scr, "F:/bmp_custom4.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_CUSTOM_4);
92
+    lv_obj_t *buttonCustom4 = lv_imgbtn_create(scr, "F:/bmp_custom4.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_4);
90
     if (enc_ena) lv_group_add_obj(g, buttonCustom4);
93
     if (enc_ena) lv_group_add_obj(g, buttonCustom4);
91
     lv_obj_t *labelCustom4 = lv_label_create_empty(buttonCustom4);
94
     lv_obj_t *labelCustom4 = lv_label_create_empty(buttonCustom4);
92
   #endif
95
   #endif
93
 
96
 
94
   #if ENABLED(USER_CMD_5_ENABLE)
97
   #if ENABLED(USER_CMD_5_ENABLE)
95
-    lv_obj_t *buttonCustom5 = lv_imgbtn_create(scr, "F:/bmp_custom5.bin", INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_5);
98
+    lv_obj_t *buttonCustom5 = lv_imgbtn_create(scr, "F:/bmp_custom5.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_5);
96
     if (enc_ena) lv_group_add_obj(g, buttonCustom5);
99
     if (enc_ena) lv_group_add_obj(g, buttonCustom5);
97
     lv_obj_t *labelCustom5 = lv_label_create_empty(buttonCustom5);
100
     lv_obj_t *labelCustom5 = lv_label_create_empty(buttonCustom5);
98
   #endif
101
   #endif
99
 
102
 
100
   #if ENABLED(USER_CMD_6_ENABLE)
103
   #if ENABLED(USER_CMD_6_ENABLE)
101
-    lv_obj_t *buttonCustom6 = lv_imgbtn_create(scr, "F:/bmp_custom6.bin", BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_6);
104
+    lv_obj_t *buttonCustom6 = lv_imgbtn_create(scr, "F:/bmp_custom6.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_6);
102
     if (enc_ena) lv_group_add_obj(g, buttonCustom6);
105
     if (enc_ena) lv_group_add_obj(g, buttonCustom6);
103
     lv_obj_t *labelCustom6 = lv_label_create_empty(buttonCustom6);
106
     lv_obj_t *labelCustom6 = lv_label_create_empty(buttonCustom6);
104
   #endif
107
   #endif
105
 
108
 
106
-  #if ENABLED(USER_CMD_7_ENABLE)
107
-    blv_obj_t *uttonCustom7 = lv_imgbtn_create(scr, "F:/bmp_custom7.bin", BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_CUSTOM_7);
108
-    if (enc_ena) lv_group_add_obj(g, buttonCustom7);
109
-    lv_obj_t *labelCustom7 = lv_label_create_empty(buttonCustom7);
110
-  #endif
111
-
112
   lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_RETURN);
109
   lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_M_RETURN);
113
   if (enc_ena) lv_group_add_obj(g, buttonBack);
110
   if (enc_ena) lv_group_add_obj(g, buttonBack);
114
   lv_obj_t *label_Back = lv_label_create_empty(buttonBack);
111
   lv_obj_t *label_Back = lv_label_create_empty(buttonBack);
115
 
112
 
116
   if (gCfgItems.multiple_language != 0) {
113
   if (gCfgItems.multiple_language != 0) {
114
+    lv_label_set_text(labelGCode, more_menu.gcode);
115
+    lv_obj_align(labelGCode, buttonGCode, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
116
+
117
     #if ENABLED(USER_CMD_1_ENABLE)
117
     #if ENABLED(USER_CMD_1_ENABLE)
118
       lv_label_set_text(labelCustom1, more_menu.custom1);
118
       lv_label_set_text(labelCustom1, more_menu.custom1);
119
       lv_obj_align(labelCustom1, buttonCustom1, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
119
       lv_obj_align(labelCustom1, buttonCustom1, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
138
       lv_label_set_text(labelCustom6, more_menu.custom6);
138
       lv_label_set_text(labelCustom6, more_menu.custom6);
139
       lv_obj_align(labelCustom6, buttonCustom6, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
139
       lv_obj_align(labelCustom6, buttonCustom6, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
140
     #endif
140
     #endif
141
-    #if ENABLED(USER_CMD_7_ENABLE)
142
-      lv_label_set_text(labelCustom7, more_menu.custom7);
143
-      lv_obj_align(labelCustom7, buttonCustom7, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
144
-    #endif
145
     lv_label_set_text(label_Back, common_menu.text_back);
141
     lv_label_set_text(label_Back, common_menu.text_back);
146
     lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
142
     lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET);
147
   }
143
   }
148
 
144
 
149
   #if BUTTONS_EXIST(EN1, EN2, ENC)
145
   #if BUTTONS_EXIST(EN1, EN2, ENC)
150
     if (enc_ena) {
146
     if (enc_ena) {
147
+      lv_group_add_obj(g, buttonGCode);
151
       TERN_(USER_CMD_1_ENABLE, lv_group_add_obj(g, buttonCustom1));
148
       TERN_(USER_CMD_1_ENABLE, lv_group_add_obj(g, buttonCustom1));
152
       TERN_(USER_CMD_2_ENABLE, lv_group_add_obj(g, buttonCustom2));
149
       TERN_(USER_CMD_2_ENABLE, lv_group_add_obj(g, buttonCustom2));
153
       TERN_(USER_CMD_3_ENABLE, lv_group_add_obj(g, buttonCustom3));
150
       TERN_(USER_CMD_3_ENABLE, lv_group_add_obj(g, buttonCustom3));
154
       TERN_(USER_CMD_4_ENABLE, lv_group_add_obj(g, buttonCustom4));
151
       TERN_(USER_CMD_4_ENABLE, lv_group_add_obj(g, buttonCustom4));
155
       TERN_(USER_CMD_5_ENABLE, lv_group_add_obj(g, buttonCustom5));
152
       TERN_(USER_CMD_5_ENABLE, lv_group_add_obj(g, buttonCustom5));
156
       TERN_(USER_CMD_6_ENABLE, lv_group_add_obj(g, buttonCustom6));
153
       TERN_(USER_CMD_6_ENABLE, lv_group_add_obj(g, buttonCustom6));
157
-      TERN_(USER_CMD_7_ENABLE, lv_group_add_obj(g, buttonCustom7));
158
       lv_group_add_obj(g, buttonBack);
154
       lv_group_add_obj(g, buttonBack);
159
     }
155
     }
160
   #endif
156
   #endif

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

71
       uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[uiCfg.curSprayerChoose].target;
71
       uiCfg.desireSprayerTempBak = thermalManager.temp_hotend[uiCfg.curSprayerChoose].target;
72
       lv_draw_filament_change();
72
       lv_draw_filament_change();
73
       break;
73
       break;
74
-    case ID_T_MORE: break;
74
+    case ID_T_MORE: lv_draw_more(); break;
75
     case ID_T_RETURN:
75
     case ID_T_RETURN:
76
       TERN_(MKS_TEST, curent_disp_ui = 1);
76
       TERN_(MKS_TEST, curent_disp_ui = 1);
77
       lv_draw_ready_print();
77
       lv_draw_ready_print();
87
   lv_big_button_create(scr, "F:/bmp_zero.bin", tool_menu.home, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_T_HOME);
87
   lv_big_button_create(scr, "F:/bmp_zero.bin", tool_menu.home, BTN_X_PIXEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_T_HOME);
88
   lv_big_button_create(scr, "F:/bmp_leveling.bin", tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling), INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_LEVELING);
88
   lv_big_button_create(scr, "F:/bmp_leveling.bin", tool_menu.TERN(AUTO_BED_LEVELING_BILINEAR, autoleveling, leveling), INTERVAL_V, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_LEVELING);
89
   lv_big_button_create(scr, "F:/bmp_filamentchange.bin", tool_menu.filament, BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight, event_handler,ID_T_FILAMENT);
89
   lv_big_button_create(scr, "F:/bmp_filamentchange.bin", tool_menu.filament, BTN_X_PIXEL+INTERVAL_V*2,BTN_Y_PIXEL+INTERVAL_H+titleHeight, event_handler,ID_T_FILAMENT);
90
+  lv_big_button_create(scr, "F:/bmp_more.bin", tool_menu.more, BTN_X_PIXEL * 2 + INTERVAL_V * 3, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_T_MORE);
90
   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_T_RETURN);
91
   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_T_RETURN);
91
 }
92
 }
92
 
93
 

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

1077
         case NOZZLE_PROBE_OFFSET_UI:    lv_draw_auto_level_offset_settings(); break;
1077
         case NOZZLE_PROBE_OFFSET_UI:    lv_draw_auto_level_offset_settings(); break;
1078
       #endif
1078
       #endif
1079
       case TOOL_UI:                     lv_draw_tool(); break;
1079
       case TOOL_UI:                     lv_draw_tool(); break;
1080
+      case GCODE_UI:                    lv_draw_gcode(); break;
1080
       case MESHLEVELING_UI:             break;
1081
       case MESHLEVELING_UI:             break;
1081
       case HARDWARE_TEST_UI:            break;
1082
       case HARDWARE_TEST_UI:            break;
1082
       #if ENABLED(MKS_WIFI_MODULE)
1083
       #if ENABLED(MKS_WIFI_MODULE)

+ 7
- 2
Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h View File

46
 #include "draw_preHeat.h"
46
 #include "draw_preHeat.h"
47
 #include "draw_extrusion.h"
47
 #include "draw_extrusion.h"
48
 #include "draw_home.h"
48
 #include "draw_home.h"
49
+#include "draw_gcode.h"
49
 #include "draw_more.h"
50
 #include "draw_more.h"
50
 #include "draw_move_motor.h"
51
 #include "draw_move_motor.h"
51
 #include "draw_fan.h"
52
 #include "draw_fan.h"
326
   WIFI_SETTINGS_UI,
327
   WIFI_SETTINGS_UI,
327
   HOMING_SENSITIVITY_UI,
328
   HOMING_SENSITIVITY_UI,
328
   ENCODER_SETTINGS_UI,
329
   ENCODER_SETTINGS_UI,
329
-  TOUCH_CALIBRATION_UI
330
+  TOUCH_CALIBRATION_UI,
331
+  GCODE_UI,
330
 } DISP_STATE;
332
 } DISP_STATE;
331
 
333
 
332
 typedef struct {
334
 typedef struct {
413
   wifiName,
415
   wifiName,
414
   wifiPassWord,
416
   wifiPassWord,
415
   wifiConfig,
417
   wifiConfig,
416
-  gcodeCommand
418
+  autoLevelGcodeCommand,
419
+  GCodeCommand,
417
 } keyboard_value_state;
420
 } keyboard_value_state;
418
 extern keyboard_value_state keyboard_value;
421
 extern keyboard_value_state keyboard_value;
419
 
422
 
449
 extern void update_spi_flash();
452
 extern void update_spi_flash();
450
 extern void update_gcode_command(int addr,uint8_t *s);
453
 extern void update_gcode_command(int addr,uint8_t *s);
451
 extern void get_gcode_command(int addr,uint8_t *d);
454
 extern void get_gcode_command(int addr,uint8_t *d);
455
+extern void lv_serial_capt_hook(void *, uint8_t);
456
+extern void lv_eom_hook(void *);
452
 #if HAS_GCODE_PREVIEW
457
 #if HAS_GCODE_PREVIEW
453
   extern void disp_pre_gcode(int xpos_pixel, int ypos_pixel);
458
   extern void disp_pre_gcode(int xpos_pixel, int ypos_pixel);
454
 #endif
459
 #endif

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

279
 #define AUTO_LEVELING_TEXT_EN   "AutoLevel"
279
 #define AUTO_LEVELING_TEXT_EN   "AutoLevel"
280
 #define SET_TEXT_EN             "Settings"
280
 #define SET_TEXT_EN             "Settings"
281
 #define MORE_TEXT_EN            "More"
281
 #define MORE_TEXT_EN            "More"
282
+#define MORE_GCODE_EN           "G-Code"
283
+#define MORE_ENTER_GCODE_EN     "Enter G-Code"
282
 
284
 
283
 #define ADD_TEXT_EN             "Add"
285
 #define ADD_TEXT_EN             "Add"
284
 #define DEC_TEXT_EN             "Dec"
286
 #define DEC_TEXT_EN             "Dec"

+ 26
- 24
Marlin/src/lcd/extui/lib/mks_ui/tft_Language_fr.h View File

22
 #pragma once
22
 #pragma once
23
 
23
 
24
 //*************法文****************************//
24
 //*************法文****************************//
25
-#define TOOL_TEXT_FR                  "prêt"
25
+#define TOOL_TEXT_FR                  "Prêt"
26
 #define PREHEAT_TEXT_FR               "Préchauffe"
26
 #define PREHEAT_TEXT_FR               "Préchauffe"
27
 #define MOVE_TEXT_FR                  "Déplace"
27
 #define MOVE_TEXT_FR                  "Déplace"
28
 #define HOME_TEXT_FR                  "Acceuil"
28
 #define HOME_TEXT_FR                  "Acceuil"
32
 #define AUTO_LEVELING_TEXT_FR         "AutoLevel"
32
 #define AUTO_LEVELING_TEXT_FR         "AutoLevel"
33
 #define SET_TEXT_FR                   "Config"
33
 #define SET_TEXT_FR                   "Config"
34
 #define MORE_TEXT_FR                  "Plus"
34
 #define MORE_TEXT_FR                  "Plus"
35
+#define MORE_GCODE_FR                 "G-Code"
36
+#define MORE_ENTER_GCODE_FR           "Saisir G-Code"
35
 
37
 
36
 #define ADD_TEXT_FR                   "Ajouter"
38
 #define ADD_TEXT_FR                   "Ajouter"
37
 #define DEC_TEXT_FR                   "Réduire"
39
 #define DEC_TEXT_FR                   "Réduire"
74
 #define PAGE_DOWN_TEXT_FR             "En bas"
76
 #define PAGE_DOWN_TEXT_FR             "En bas"
75
 
77
 
76
 #define EXTRUDER_IN_TEXT_FR           "Insérer"
78
 #define EXTRUDER_IN_TEXT_FR           "Insérer"
77
-#define EXTRUDER_OUT_TEXT_FR          "éjecter"
79
+#define EXTRUDER_OUT_TEXT_FR          "Éjecter"
78
 #define EXTRUDE_1MM_TEXT_FR           "1mm"
80
 #define EXTRUDE_1MM_TEXT_FR           "1mm"
79
 #define EXTRUDE_5MM_TEXT_FR           "5mm"
81
 #define EXTRUDE_5MM_TEXT_FR           "5mm"
80
 #define EXTRUDE_10MM_TEXT_FR          "10mm"
82
 #define EXTRUDE_10MM_TEXT_FR          "10mm"
91
 #define FILESYS_TEXT_FR               "Fichier"
93
 #define FILESYS_TEXT_FR               "Fichier"
92
 #define WIFI_TEXT_FR                  "WiFi"
94
 #define WIFI_TEXT_FR                  "WiFi"
93
 #define FAN_TEXT_FR                   "Fan"
95
 #define FAN_TEXT_FR                   "Fan"
94
-#define ABOUT_TEXT_FR                 "A propos"
96
+#define ABOUT_TEXT_FR                 "À propos"
95
 #define BREAK_POINT_TEXT_FR           "Continuer"
97
 #define BREAK_POINT_TEXT_FR           "Continuer"
96
 #define FILAMENT_TEXT_FR              "Remplacer"
98
 #define FILAMENT_TEXT_FR              "Remplacer"
97
 #define LANGUAGE_TEXT_FR              "Langue"
99
 #define LANGUAGE_TEXT_FR              "Langue"
98
 #define MOTOR_OFF_TEXT_FR             "M-hors"
100
 #define MOTOR_OFF_TEXT_FR             "M-hors"
99
 #define MOTOR_OFF_XY_TEXT_FR          "M-hors-XY"
101
 #define MOTOR_OFF_XY_TEXT_FR          "M-hors-XY"
100
-#define SHUTDOWN_TEXT_FR              "Eteindre"
102
+#define SHUTDOWN_TEXT_FR              "Éteindre"
101
 #define MACHINE_PARA_FR               "Config"
103
 #define MACHINE_PARA_FR               "Config"
102
 #define EEPROM_SETTINGS_FR            "Eeprom Set"
104
 #define EEPROM_SETTINGS_FR            "Eeprom Set"
103
 
105
 
130
 #define FAN_TIPS2_TEXT_FR             "ventilateur\n0"
132
 #define FAN_TIPS2_TEXT_FR             "ventilateur\n0"
131
 
133
 
132
 #define FILAMENT_IN_TEXT_FR           "Insérer"
134
 #define FILAMENT_IN_TEXT_FR           "Insérer"
133
-#define FILAMENT_OUT_TEXT_FR          "éjecter"
135
+#define FILAMENT_OUT_TEXT_FR          "Éjecter"
134
 #define FILAMENT_EXT0_TEXT_FR         "Extr1"
136
 #define FILAMENT_EXT0_TEXT_FR         "Extr1"
135
 #define FILAMENT_EXT1_TEXT_FR         "Extr2"
137
 #define FILAMENT_EXT1_TEXT_FR         "Extr2"
136
 #define FILAMENT_HEAT_TEXT_FR         "Preheat"
138
 #define FILAMENT_HEAT_TEXT_FR         "Preheat"
137
 #define FILAMENT_STOP_TEXT_FR         "Arrêter"
139
 #define FILAMENT_STOP_TEXT_FR         "Arrêter"
138
 #define FILAMENT_TIPS2_TEXT_FR        "T:"
140
 #define FILAMENT_TIPS2_TEXT_FR        "T:"
139
 #define FILAMENT_TIPS3_TEXT_FR        "Insérer le filament..."
141
 #define FILAMENT_TIPS3_TEXT_FR        "Insérer le filament..."
140
-#define FILAMENT_TIPS4_TEXT_FR        "éjecter le filament..."
142
+#define FILAMENT_TIPS4_TEXT_FR        "Éjecter le filament..."
141
 #define FILAMENT_TIPS5_TEXT_FR        "Température trop basse pour démarrer, chauffez svp"
143
 #define FILAMENT_TIPS5_TEXT_FR        "Température trop basse pour démarrer, chauffez svp"
142
 #define FILAMENT_TIPS6_TEXT_FR        "Terminé"
144
 #define FILAMENT_TIPS6_TEXT_FR        "Terminé"
143
 
145
 
144
-#define FILAMENT_CHANGE_TEXT_FR                   "Please click <Load> \nor <unload>,After \npinter pause."
145
-#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR         "Heating up the nozzle,\nplease wait..."
146
-#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR       "Heating up the nozzle,\nplease wait..."
147
-#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR     "Heat completed,please load filament \nto extruder,and click <confirm> \nfor start loading."
148
-#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR     "Please load filament to extruder,\nand click <confirm> for start loading."
149
-#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR    "Heat completed,please \nclick <confirm> for start unloading.!"
150
-#define FILAMENT_DIALOG_LOADING_TIPS_FR           "Is loading ,please wait!"
151
-#define FILAMENT_DIALOG_UNLOADING_TIPS_FR         "Is unloading,please wait!"
152
-#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR     "Load filament completed,\nclick <confirm> for return!"
153
-#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR   "Unload filament completed,\nclick <confirm> for return!"
146
+#define FILAMENT_CHANGE_TEXT_FR                   "Veuillez presser <Load> \nou <unload>, après \nla pause."
147
+#define FILAMENT_DIALOG_LOAD_HEAT_TIPS_FR         "Chauffe de la tête\nPatientez SVP..."
148
+#define FILAMENT_DIALOG_UNLOAD_HEAT_TIPS_FR       "Chauffe de la tête\nPatientez SVP..."
149
+#define FILAMENT_DIALOG_LOAD_CONFIRM1_TIPS_FR     "Tête chaude, veuillez charger le\nfilament dans l'extruder & <confirmer>\nle chargement."
150
+#define FILAMENT_DIALOG_LOAD_CONFIRM2_TIPS_FR     "Veuillez charger le filament dans\nl'extruder & <confirmer> le chargement."
151
+#define FILAMENT_DIALOG_UNLOAD_CONFIRM_TIPS_FR    "Tête chaude, <confirmez>\npour le déchargement."
152
+#define FILAMENT_DIALOG_LOADING_TIPS_FR           "Chargement, patientez SVP."
153
+#define FILAMENT_DIALOG_UNLOADING_TIPS_FR         "Déchargement, patientez SVP."
154
+#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR     "Chargement terminé,\n<confirmez> pour revenir!"
155
+#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR   "Déchargement terminé,\n<confirmez> pour revenir!"
154
 
156
 
155
 
157
 
156
 #define PRE_HEAT_EXT_TEXT_FR          "E"
158
 #define PRE_HEAT_EXT_TEXT_FR          "E"
205
 #define TITLE_FAN_FR                  "Ventilateur"
207
 #define TITLE_FAN_FR                  "Ventilateur"
206
 #define TITLE_LANGUAGE_FR             "Langue"
208
 #define TITLE_LANGUAGE_FR             "Langue"
207
 #define TITLE_PAUSE_FR                "Pause"
209
 #define TITLE_PAUSE_FR                "Pause"
208
-#define TITLE_CHANGESPEED_FR          "Speed"
210
+#define TITLE_CHANGESPEED_FR          "Vitesse"
209
 #define TITLE_CLOUD_TEXT_FR           "Cloud"
211
 #define TITLE_CLOUD_TEXT_FR           "Cloud"
210
-#define TITLE_DIALOG_CONFIRM_FR       "Confirm"
212
+#define TITLE_DIALOG_CONFIRM_FR       "Confirmer"
211
 #define TITLE_FILESYS_FR              "FileSys"
213
 #define TITLE_FILESYS_FR              "FileSys"
212
 
214
 
213
-#define DIALOG_CLOSE_MACHINE_FR       "Closing machine......"
215
+#define DIALOG_CLOSE_MACHINE_FR       "Extinction..."
214
 
216
 
215
 #define AUTO_SHUTDOWN_FR              "Auto"
217
 #define AUTO_SHUTDOWN_FR              "Auto"
216
 #define MANUAL_SHUTDOWN_FR            "Manuel"
218
 #define MANUAL_SHUTDOWN_FR            "Manuel"
220
 #define DIALOG_OK_FR                  "OK"
222
 #define DIALOG_OK_FR                  "OK"
221
 #define DIALOG_RESET_FR               "Réinitialiser"
223
 #define DIALOG_RESET_FR               "Réinitialiser"
222
 #define DIALOG_RETRY_FR               "Recommencez"
224
 #define DIALOG_RETRY_FR               "Recommencez"
223
-#define DIALOG_DISABLE_FR             "Disable"
225
+#define DIALOG_DISABLE_FR             "Désactiver"
224
 #define DIALOG_PRINT_MODEL_FR         "Imprimer le fichier?"
226
 #define DIALOG_PRINT_MODEL_FR         "Imprimer le fichier?"
225
 #define DIALOG_CANCEL_PRINT_FR        "Arrêter?"
227
 #define DIALOG_CANCEL_PRINT_FR        "Arrêter?"
226
 
228
 
229
 #define DIALOG_ERROR_TIPS1_FR         "Erreur:error:Aucun fichier, \nvérifiez à nouveau."
231
 #define DIALOG_ERROR_TIPS1_FR         "Erreur:error:Aucun fichier, \nvérifiez à nouveau."
230
 #define DIALOG_ERROR_TIPS2_FR         "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!"
232
 #define DIALOG_ERROR_TIPS2_FR         "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!"
231
 #define DIALOG_ERROR_TIPS3_FR         "Erreur: le nom du fichier ou le \nchemin d'accès est trop long."
233
 #define DIALOG_ERROR_TIPS3_FR         "Erreur: le nom du fichier ou le \nchemin d'accès est trop long."
232
-#define DIALOG_UNBIND_PRINTER_FR      "Unbind the printer?"
233
-#define DIALOG_FILAMENT_NO_PRESS_FR   "Filament detection switch is not pressed"
234
+#define DIALOG_UNBIND_PRINTER_FR      "Déconnecter l'imprimante?"
235
+#define DIALOG_FILAMENT_NO_PRESS_FR   "Détecteur de filament non pressé"
234
 #define DIALOG_PRINT_FINISH_FR        "L'impression est terminée!"
236
 #define DIALOG_PRINT_FINISH_FR        "L'impression est terminée!"
235
 #define DIALOG_PRINT_TIME_FR          "Temps d'impression: "
237
 #define DIALOG_PRINT_TIME_FR          "Temps d'impression: "
236
-#define DIALOG_REPRINT_FR             "Print again"
237
-#define DIALOG_WIFI_ENABLE_TIPS_FR    "The wifi module is being configured,\nplease wait a moment....."
238
+#define DIALOG_REPRINT_FR             "Réimprimer"
239
+#define DIALOG_WIFI_ENABLE_TIPS_FR    "Le module WIFI se charge\nAttendez SVP..."
238
 
240
 
239
 #define MESSAGE_PAUSING_FR        "Parking..."
241
 #define MESSAGE_PAUSING_FR        "Parking..."
240
 #define MESSAGE_CHANGING_FR       "Attente filament pour démarrer"
242
 #define MESSAGE_CHANGING_FR       "Attente filament pour démarrer"

+ 2
- 0
Marlin/src/lcd/extui/lib/mks_ui/tft_Language_it.h View File

32
 #define AUTO_LEVELING_TEXT_IT         "AutoLevel"
32
 #define AUTO_LEVELING_TEXT_IT         "AutoLevel"
33
 #define SET_TEXT_IT                   "Imposta"
33
 #define SET_TEXT_IT                   "Imposta"
34
 #define MORE_TEXT_IT                  "Di più"
34
 #define MORE_TEXT_IT                  "Di più"
35
+#define MORE_GCODE_IT                 "G-Code"
36
+#define MORE_ENTER_GCODE_IT           "Inserisci il G-Code"
35
 
37
 
36
 #define ADD_TEXT_IT                   "Aumentare"
38
 #define ADD_TEXT_IT                   "Aumentare"
37
 #define DEC_TEXT_IT                   "Ridurre"
39
 #define DEC_TEXT_IT                   "Ridurre"

+ 2
- 0
Marlin/src/lcd/extui/lib/mks_ui/tft_Language_ru.h View File

32
 #define AUTO_LEVELING_TEXT_RU           "aвтоуровень"
32
 #define AUTO_LEVELING_TEXT_RU           "aвтоуровень"
33
 #define SET_TEXT_RU                     "настройки"
33
 #define SET_TEXT_RU                     "настройки"
34
 #define MORE_TEXT_RU                    "больше"
34
 #define MORE_TEXT_RU                    "больше"
35
+#define MORE_GCODE_RU                   "G-код"
36
+#define MORE_ENTER_GCODE_RU             "Введите G-код"
35
 
37
 
36
 #define ADD_TEXT_RU                     "добавить"
38
 #define ADD_TEXT_RU                     "добавить"
37
 #define DEC_TEXT_RU                     "уменьшить"
39
 #define DEC_TEXT_RU                     "уменьшить"

+ 2
- 0
Marlin/src/lcd/extui/lib/mks_ui/tft_Language_s_cn.h View File

263
 #define AUTO_LEVELING_TEXT_CN       "自动调平"
263
 #define AUTO_LEVELING_TEXT_CN       "自动调平"
264
 #define SET_TEXT_CN                 "设置"
264
 #define SET_TEXT_CN                 "设置"
265
 #define MORE_TEXT_CN                "更多"
265
 #define MORE_TEXT_CN                "更多"
266
+#define MORE_GCODE_CN               "G-Code"
267
+#define MORE_ENTER_GCODE_CN         "Enter G-Code"
266
 
268
 
267
 #define ADD_TEXT_CN                 "增加"
269
 #define ADD_TEXT_CN                 "增加"
268
 #define DEC_TEXT_CN                 "减少"
270
 #define DEC_TEXT_CN                 "减少"

+ 2
- 0
Marlin/src/lcd/extui/lib/mks_ui/tft_Language_sp.h View File

33
 #define AUTO_LEVELING_TEXT_SP   "Autolevel"
33
 #define AUTO_LEVELING_TEXT_SP   "Autolevel"
34
 #define SET_TEXT_SP             "Config"
34
 #define SET_TEXT_SP             "Config"
35
 #define MORE_TEXT_SP            "Más"
35
 #define MORE_TEXT_SP            "Más"
36
+#define MORE_GCODE_SP           "G-Code"
37
+#define MORE_ENTER_GCODE_SP     "Introduzca el G-Code"
36
 
38
 
37
 #define ADD_TEXT_SP             "Más"
39
 #define ADD_TEXT_SP             "Más"
38
 #define DEC_TEXT_SP             "Menos"
40
 #define DEC_TEXT_SP             "Menos"

+ 2
- 0
Marlin/src/lcd/extui/lib/mks_ui/tft_Language_t_cn.h View File

263
 #define AUTO_LEVELING_TEXT_T_CN         "自動調平"
263
 #define AUTO_LEVELING_TEXT_T_CN         "自動調平"
264
 #define SET_TEXT_T_CN                   "設置"
264
 #define SET_TEXT_T_CN                   "設置"
265
 #define MORE_TEXT_T_CN                  "更多"
265
 #define MORE_TEXT_T_CN                  "更多"
266
+#define MORE_GCODE_T_CN                 "G-Code"
267
+#define MORE_ENTER_GCODE_T_CN           "Enter G-Code"
266
 
268
 
267
 #define ADD_TEXT_T_CN                   "增加"
269
 #define ADD_TEXT_T_CN                   "增加"
268
 #define DEC_TEXT_T_CN                   "減少"
270
 #define DEC_TEXT_T_CN                   "減少"

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

943
       filesys_menu.usb_sys = U_DISK_TEXT_CN;
943
       filesys_menu.usb_sys = U_DISK_TEXT_CN;
944
       //
944
       //
945
       more_menu.title       = TITLE_MORE_CN;
945
       more_menu.title       = TITLE_MORE_CN;
946
+      more_menu.gcode       = MORE_GCODE_CN;
947
+      more_menu.entergcode  = MORE_ENTER_GCODE_CN;
946
       TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_CN);
948
       TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_CN);
947
       TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_CN);
949
       TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_CN);
948
       TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_CN);
950
       TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_CN);
1175
             filesys_menu.usb_sys  = U_DISK_TEXT_T_CN;
1177
             filesys_menu.usb_sys  = U_DISK_TEXT_T_CN;
1176
             //
1178
             //
1177
             more_menu.title       = TITLE_MORE_T_CN;
1179
             more_menu.title       = TITLE_MORE_T_CN;
1180
+            more_menu.gcode       = MORE_GCODE_T_CN;
1181
+            more_menu.entergcode  = MORE_ENTER_GCODE_T_CN;
1178
             TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_T_CN);
1182
             TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_T_CN);
1179
             TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_T_CN);
1183
             TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_T_CN);
1180
             TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_T_CN);
1184
             TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_T_CN);
1394
             set_menu.eepromSet    = EEPROM_SETTINGS_EN;
1398
             set_menu.eepromSet    = EEPROM_SETTINGS_EN;
1395
             //
1399
             //
1396
             more_menu.title       = TITLE_MORE_EN;
1400
             more_menu.title       = TITLE_MORE_EN;
1401
+            more_menu.gcode       = MORE_GCODE_EN;
1402
+            more_menu.entergcode  = MORE_ENTER_GCODE_EN;
1397
             TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_EN);
1403
             TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_EN);
1398
             TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_EN);
1404
             TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_EN);
1399
             TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_EN);
1405
             TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_EN);
1614
             set_menu.machine_para = MACHINE_PARA_RU;
1620
             set_menu.machine_para = MACHINE_PARA_RU;
1615
             set_menu.eepromSet    = EEPROM_SETTINGS_RU;
1621
             set_menu.eepromSet    = EEPROM_SETTINGS_RU;
1616
             more_menu.title       = TITLE_MORE_RU;
1622
             more_menu.title       = TITLE_MORE_RU;
1623
+            more_menu.gcode       = MORE_GCODE_RU;
1624
+            more_menu.entergcode  = MORE_ENTER_GCODE_RU;
1617
             #if ENABLED(USER_CMD_1_ENABLE)
1625
             #if ENABLED(USER_CMD_1_ENABLE)
1618
               more_menu.custom1 = MORE_CUSTOM1_TEXT_RU;
1626
               more_menu.custom1 = MORE_CUSTOM1_TEXT_RU;
1619
             #endif
1627
             #endif
1944
             set_menu.machine_para = MACHINE_PARA_SP;
1952
             set_menu.machine_para = MACHINE_PARA_SP;
1945
             set_menu.eepromSet    = EEPROM_SETTINGS_SP;
1953
             set_menu.eepromSet    = EEPROM_SETTINGS_SP;
1946
             more_menu.title       = TITLE_MORE_SP;
1954
             more_menu.title       = TITLE_MORE_SP;
1955
+            more_menu.gcode       = MORE_GCODE_SP;
1956
+            more_menu.entergcode  = MORE_ENTER_GCODE_SP;
1947
             #if ENABLED(USER_CMD_1_ENABLE)
1957
             #if ENABLED(USER_CMD_1_ENABLE)
1948
               more_menu.custom1 = MORE_CUSTOM1_TEXT_SP;
1958
               more_menu.custom1 = MORE_CUSTOM1_TEXT_SP;
1949
             #endif
1959
             #endif
2179
           set_menu.machine_para = MACHINE_PARA_FR;
2189
           set_menu.machine_para = MACHINE_PARA_FR;
2180
           set_menu.eepromSet    = EEPROM_SETTINGS_FR;
2190
           set_menu.eepromSet    = EEPROM_SETTINGS_FR;
2181
           more_menu.title       = TITLE_MORE_FR;
2191
           more_menu.title       = TITLE_MORE_FR;
2192
+          more_menu.gcode       = MORE_GCODE_FR;
2193
+          more_menu.entergcode  = MORE_ENTER_GCODE_FR;
2182
           #if ENABLED(USER_CMD_1_ENABLE)
2194
           #if ENABLED(USER_CMD_1_ENABLE)
2183
             more_menu.custom1 = MORE_CUSTOM1_TEXT_FR;
2195
             more_menu.custom1 = MORE_CUSTOM1_TEXT_FR;
2184
           #endif
2196
           #endif
2415
           set_menu.machine_para = MACHINE_PARA_IT;
2427
           set_menu.machine_para = MACHINE_PARA_IT;
2416
           set_menu.eepromSet    = EEPROM_SETTINGS_IT;
2428
           set_menu.eepromSet    = EEPROM_SETTINGS_IT;
2417
           more_menu.title       = TITLE_MORE_IT;
2429
           more_menu.title       = TITLE_MORE_IT;
2430
+          more_menu.gcode       = MORE_GCODE_IT;
2431
+          more_menu.entergcode  = MORE_ENTER_GCODE_IT;
2418
           #if ENABLED(USER_CMD_1_ENABLE)
2432
           #if ENABLED(USER_CMD_1_ENABLE)
2419
             more_menu.custom1 = MORE_CUSTOM1_TEXT_IT;
2433
             more_menu.custom1 = MORE_CUSTOM1_TEXT_IT;
2420
           #endif
2434
           #endif
2651
       set_menu.eepromSet    = EEPROM_SETTINGS_EN;
2665
       set_menu.eepromSet    = EEPROM_SETTINGS_EN;
2652
       //
2666
       //
2653
       more_menu.title       = TITLE_MORE_EN;
2667
       more_menu.title       = TITLE_MORE_EN;
2668
+      more_menu.gcode       = MORE_GCODE_EN;
2669
+      more_menu.entergcode  = MORE_ENTER_GCODE_EN;
2654
       TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_EN);
2670
       TERN_(USER_CMD_1_ENABLE, more_menu.custom1 = MORE_CUSTOM1_TEXT_EN);
2655
       TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_EN);
2671
       TERN_(USER_CMD_2_ENABLE, more_menu.custom2 = MORE_CUSTOM2_TEXT_EN);
2656
       TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_EN);
2672
       TERN_(USER_CMD_3_ENABLE, more_menu.custom3 = MORE_CUSTOM3_TEXT_EN);

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

464
   const char *custom5;
464
   const char *custom5;
465
   const char *custom6;
465
   const char *custom6;
466
   const char *custom7;
466
   const char *custom7;
467
+  const char *gcode;
468
+  const char *entergcode;
467
   const char *back;
469
   const char *back;
468
 } more_menu_def;
470
 } more_menu_def;
469
 
471
 

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

80
       }
80
       }
81
       /* TXE signifies readiness to send a byte to DR. */
81
       /* TXE signifies readiness to send a byte to DR. */
82
       if ((regs->CR1 & USART_CR1_TXEIE) && (regs->SR & USART_SR_TXE)) {
82
       if ((regs->CR1 & USART_CR1_TXEIE) && (regs->SR & USART_SR_TXE)) {
83
-          if (!rb_is_empty(this->usart_device->wb))
84
-              regs->DR=rb_remove(this->usart_device->wb);
85
-          else
86
-              regs->CR1 &= ~((uint32)USART_CR1_TXEIE); // disable TXEIE
83
+        if (!rb_is_empty(this->usart_device->wb))
84
+          regs->DR=rb_remove(this->usart_device->wb);
85
+        else
86
+          regs->CR1 &= ~((uint32)USART_CR1_TXEIE); // disable TXEIE
87
       }
87
       }
88
     }
88
     }
89
 
89
 

+ 3
- 2
buildroot/tests/mega2560-tests View File

72
 opt_set TEMP_SENSOR_2 1
72
 opt_set TEMP_SENSOR_2 1
73
 opt_set TEMP_SENSOR_3 1
73
 opt_set TEMP_SENSOR_3 1
74
 opt_set TEMP_SENSOR_4 1
74
 opt_set TEMP_SENSOR_4 1
75
-opt_enable VIKI2 Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \
76
-           AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \
75
+opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS \
76
+           Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE \
77
+           EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \
77
            NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \
78
            NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \
78
            DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \
79
            DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \
79
            FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULLUP
80
            FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULLUP

+ 8
- 8
docs/Serial.md View File

10
 
10
 
11
 ## Common interface
11
 ## Common interface
12
 
12
 
13
-This interface is declared in `Marlin/src/core/serial_base.h` 
13
+This interface is declared in `Marlin/src/core/serial_base.h`
14
 Any implementation will need to follow this interface for being used transparently in Marlin's codebase.
14
 Any implementation will need to follow this interface for being used transparently in Marlin's codebase.
15
 
15
 
16
 The implementation was written to prioritize performance over abstraction, so the base interface is not using virtual inheritance to avoid the cost of virtual dispatching while calling methods.
16
 The implementation was written to prioritize performance over abstraction, so the base interface is not using virtual inheritance to avoid the cost of virtual dispatching while calling methods.
17
 Instead, the Curiously Recurring Template Pattern (**CRTP**) is used so that, upon compilation, the interface abstraction does not incur a performance cost.
17
 Instead, the Curiously Recurring Template Pattern (**CRTP**) is used so that, upon compilation, the interface abstraction does not incur a performance cost.
18
 
18
 
19
-Because some platform do not follow the same interface, the missing method in the actual low-level implementation are detected via SFINAE and a wrapper is generated when such method are missing. See `CALL_IF_EXISTS` macro in `Marlin/src/core/macros.h` for the documentation of this technic.  
19
+Because some platform do not follow the same interface, the missing method in the actual low-level implementation are detected via SFINAE and a wrapper is generated when such method are missing. See `CALL_IF_EXISTS` macro in `Marlin/src/core/macros.h` for the documentation of this technic.
20
 
20
 
21
 ## Composing the desired feature
21
 ## Composing the desired feature
22
 The different specificities for each architecture are provided by composing the serial type based on desired functionality.
22
 The different specificities for each architecture are provided by composing the serial type based on desired functionality.
25
 2. `ForwardSerial` is a composing wrapper. It references an actual Arduino compatible `Serial` instance. You'll use this if the instance is declared in the platform's framework and is being referred directly in the framework. This is not as efficient as the `BaseSerial` implementation since static dereferencing is done for each method call (it'll still be faster than virtual dispatching)
25
 2. `ForwardSerial` is a composing wrapper. It references an actual Arduino compatible `Serial` instance. You'll use this if the instance is declared in the platform's framework and is being referred directly in the framework. This is not as efficient as the `BaseSerial` implementation since static dereferencing is done for each method call (it'll still be faster than virtual dispatching)
26
 3. `ConditionalSerial` is working a bit like the `ForwardSerial` interface, but it checks a boolean condition before calling the referenced instance. You'll use it when the serial output can be switch off at runtime, for example in a *telnet* like serial output that should not emit any packet if no client is connected.
26
 3. `ConditionalSerial` is working a bit like the `ForwardSerial` interface, but it checks a boolean condition before calling the referenced instance. You'll use it when the serial output can be switch off at runtime, for example in a *telnet* like serial output that should not emit any packet if no client is connected.
27
 4. `RuntimeSerial` is providing a runtime-modifiable hooking method for its `write` and `msgDone` method. You'll use it if you need to capture the serial output of Marlin, for example to display the G-Code parser's output on a GUI interface. The hooking interface is setup via the `setHook` method.
27
 4. `RuntimeSerial` is providing a runtime-modifiable hooking method for its `write` and `msgDone` method. You'll use it if you need to capture the serial output of Marlin, for example to display the G-Code parser's output on a GUI interface. The hooking interface is setup via the `setHook` method.
28
-5. `MultiSerial` is a runtime modifiable serial output multiplexer. It can output (*respectively input*) to 2 different interface based on a port *mask*. You'll use this if you need to output the same serial stream to multiple port. You can plug a `MultiSerial` to itself to duplicate to more than 2 ports. 
28
+5. `MultiSerial` is a runtime modifiable serial output multiplexer. It can output (*respectively input*) to 2 different interface based on a port *mask*. You'll use this if you need to output the same serial stream to multiple port. You can plug a `MultiSerial` to itself to duplicate to more than 2 ports.
29
 
29
 
30
 ## Plumbing
30
 ## Plumbing
31
-Since all the types above are using CRTP, it's possible to combine them to get the appropriate functionality. 
32
-This is easily done via type definition of the feature. 
31
+Since all the types above are using CRTP, it's possible to combine them to get the appropriate functionality.
32
+This is easily done via type definition of the feature.
33
 
33
 
34
 For example, to present a serial interface that's outputting to 2 serial port, the first one being hooked at runtime and the second one connected to a runtime switchable telnet client, you'll declare the type to use as:
34
 For example, to present a serial interface that's outputting to 2 serial port, the first one being hooked at runtime and the second one connected to a runtime switchable telnet client, you'll declare the type to use as:
35
 ```
35
 ```
37
 ```
37
 ```
38
 
38
 
39
 ## Emergency parser
39
 ## Emergency parser
40
-By default, the serial base interface provide an emergency parser that's only enable for serial classes that support it. 
41
-Because of this condition, all underlying type takes a first `bool emergencyParserEnabled` argument to their constructor. You must take into account this parameter when defining the actual type used. 
40
+By default, the serial base interface provide an emergency parser that's only enable for serial classes that support it.
41
+Because of this condition, all underlying type takes a first `bool emergencyParserEnabled` argument to their constructor. You must take into account this parameter when defining the actual type used.
42
 
42
 
43
 
43
 
44
-*This document was written by [X-Ryl669](https://blog.cyril.by) and is under [CC-SA license](https://creativecommons.org/licenses/by-sa)*
44
+*This document was written by [X-Ryl669](https://blog.cyril.by) and is under [CC-SA license](https://creativecommons.org/licenses/by-sa)*

Loading…
Cancel
Save