Selaa lähdekoodia

Fix & clean up ExtUI (#14748)

Ludy 5 vuotta sitten
vanhempi
commit
97e9c95f47

+ 4
- 0
Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp Näytä tiedosto

28
 
28
 
29
   #include "../../../module/motion.h"
29
   #include "../../../module/motion.h"
30
   #include "../../../feature/bedlevel/bedlevel.h"
30
   #include "../../../feature/bedlevel/bedlevel.h"
31
+  
32
+  #if ENABLED(EXTENSIBLE_UI)
33
+    #include "../../../lcd/extensible_ui/ui_api.h"
34
+  #endif
31
 
35
 
32
   mesh_bed_leveling mbl;
36
   mesh_bed_leveling mbl;
33
 
37
 

+ 4
- 0
Marlin/src/gcode/bedlevel/mbl/G29.cpp Näytä tiedosto

37
 #include "../../../lcd/ultralcd.h"
37
 #include "../../../lcd/ultralcd.h"
38
 #include "../../../module/motion.h"
38
 #include "../../../module/motion.h"
39
 #include "../../../module/stepper.h"
39
 #include "../../../module/stepper.h"
40
+  
41
+#if ENABLED(EXTENSIBLE_UI)
42
+  #include "../../../lcd/extensible_ui/ui_api.h"
43
+#endif
40
 
44
 
41
 // Save 130 bytes with non-duplication of PSTR
45
 // Save 130 bytes with non-duplication of PSTR
42
 inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); }
46
 inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); }

+ 23
- 26
Marlin/src/lcd/extui_malyan_lcd.cpp Näytä tiedosto

114
 void process_lcd_c_command(const char* command) {
114
 void process_lcd_c_command(const char* command) {
115
   switch (command[0]) {
115
   switch (command[0]) {
116
     case 'C': // Cope with both V1 early rev and later LCDs.
116
     case 'C': // Cope with both V1 early rev and later LCDs.
117
-    case 'S': {
117
+    case 'S':
118
       feedrate_percentage = atoi(command + 1) * 10;
118
       feedrate_percentage = atoi(command + 1) * 10;
119
       LIMIT(feedrate_percentage, 10, 999);
119
       LIMIT(feedrate_percentage, 10, 999);
120
-    } break;
121
-    case 'T': {
122
-      thermalManager.setTargetHotend(atoi(command + 1), 0);
123
-    } break;
124
-    case 'P': {
125
-      thermalManager.setTargetBed(atoi(command + 1));
126
-    } break;
120
+      break;
127
 
121
 
128
-    default:
129
-      SERIAL_ECHOLNPAIR("UNKNOWN C COMMAND", command);
130
-      return;
122
+    case 'T': thermalManager.setTargetHotend(atoi(command + 1), 0); break;
123
+
124
+    #if HAS_HEATED_BED
125
+      case 'P': thermalManager.setTargetBed(atoi(command + 1)); break;
126
+    #endif
127
+
128
+    default: SERIAL_ECHOLNPAIR("UNKNOWN C COMMAND", command);
131
   }
129
   }
132
 }
130
 }
133
 
131
 
148
 
146
 
149
       char message_buffer[MAX_CURLY_COMMAND];
147
       char message_buffer[MAX_CURLY_COMMAND];
150
       sprintf_P(message_buffer,
148
       sprintf_P(message_buffer,
151
-              PSTR("{T0:%03.0f/%03i}{T1:000/000}{TP:%03.0f/%03i}{TQ:%03i}{TT:%s}"),
152
-              thermalManager.degHotend(0),
153
-              thermalManager.degTargetHotend(0),
154
-              #if HAS_HEATED_BED
155
-                thermalManager.degBed(),
156
-                thermalManager.degTargetBed(),
157
-              #else
158
-                0, 0,
159
-              #endif
160
-              #if ENABLED(SDSUPPORT)
161
-                card.percentDone(),
162
-              #else
163
-                0,
164
-              #endif
165
-              elapsed_buffer);
149
+        PSTR("{T0:%03.0f/%03i}{T1:000/000}{TP:%03.0f/%03i}{TQ:%03i}{TT:%s}"),
150
+        thermalManager.degHotend(0), thermalManager.degTargetHotend(0),
151
+        #if HAS_HEATED_BED
152
+          thermalManager.degBed(), thermalManager.degTargetBed(),
153
+        #else
154
+          0, 0,
155
+        #endif
156
+        #if ENABLED(SDSUPPORT)
157
+          card.percentDone(),
158
+        #else
159
+          0,
160
+        #endif
161
+        elapsed_buffer
162
+      );
166
       write_to_lcd(message_buffer);
163
       write_to_lcd(message_buffer);
167
     } break;
164
     } break;
168
 
165
 

+ 1
- 3
Marlin/src/module/configuration_store.cpp Näytä tiedosto

98
   #include "../feature/runout.h"
98
   #include "../feature/runout.h"
99
 #endif
99
 #endif
100
 
100
 
101
-#include "../lcd/extensible_ui/ui_api.h"
102
-
103
 #if ENABLED(EXTRA_LIN_ADVANCE_K)
101
 #if ENABLED(EXTRA_LIN_ADVANCE_K)
104
-extern float saved_extruder_advance_K[EXTRUDERS];
102
+  extern float saved_extruder_advance_K[EXTRUDERS];
105
 #endif
103
 #endif
106
 
104
 
107
 #if EXTRUDERS > 1
105
 #if EXTRUDERS > 1

Loading…
Peruuta
Tallenna