Переглянути джерело

Fix UBL compilation warnings

Thomas Moore 6 роки тому
джерело
коміт
8afc4f8d9d

+ 1
- 1
Marlin/src/feature/pause.h Переглянути файл

@@ -30,7 +30,7 @@
30 30
 
31 31
 #include "../libs/nozzle.h"
32 32
 
33
-extern bool did_pause_print;
33
+extern uint8_t did_pause_print;
34 34
 
35 35
 bool pause_print(const float &retract, const point_t &park_point, const float &unload_length=0,
36 36
                  const int8_t max_beep_count=0, const bool show_lcd=false

+ 19
- 1
Marlin/src/gcode/queue.cpp Переглянути файл

@@ -147,9 +147,27 @@ static bool drain_injected_commands_P() {
147 147
  */
148 148
 void enqueue_and_echo_commands_P(const char * const pgcode) {
149 149
   injected_commands_P = pgcode;
150
-  drain_injected_commands_P(); // first command executed asap (when possible)
150
+  (void)drain_injected_commands_P(); // first command executed asap (when possible)
151 151
 }
152 152
 
153
+#if HAS_QUEUE_NOW
154
+  /**
155
+   * Enqueue and return only when commands are actually enqueued
156
+   */
157
+  void enqueue_and_echo_command_now(const char* cmd, bool say_ok/*=false*/) {
158
+    while (!enqueue_and_echo_command(cmd, say_ok)) idle();
159
+  }
160
+  #if HAS_LCD_QUEUE_NOW
161
+    /**
162
+     * Enqueue from program memory and return only when commands are actually enqueued
163
+     */
164
+    void enqueue_and_echo_commands_P_now(const char * const pgcode) {
165
+      enqueue_and_echo_commands_P(pgcode);
166
+      while (drain_injected_commands_P()) idle();
167
+    }
168
+  #endif
169
+#endif
170
+
153 171
 /**
154 172
  * Send an "ok" message to the host, indicating
155 173
  * that a command was successfully processed.

+ 16
- 0
Marlin/src/gcode/queue.h Переглянути файл

@@ -90,6 +90,22 @@ void enqueue_and_echo_commands_P(const char * const pgcode);
90 90
  */
91 91
 bool enqueue_and_echo_command(const char* cmd, bool say_ok=false);
92 92
 
93
+#define HAS_LCD_QUEUE_NOW (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)))
94
+#define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW)
95
+
96
+#if HAS_QUEUE_NOW
97
+  /**
98
+   * Enqueue and return only when commands are actually enqueued
99
+   */
100
+  void enqueue_and_echo_command_now(const char* cmd, bool say_ok=false);
101
+  #if HAS_LCD_QUEUE_NOW
102
+    /**
103
+     * Enqueue from program memory and return only when commands are actually enqueued
104
+     */
105
+    void enqueue_and_echo_commands_P_now(const char * const cmd);
106
+  #endif
107
+#endif
108
+
93 109
 /**
94 110
  * Add to the circular command queue the next command from:
95 111
  *  - The command-injection queue (injected_commands_P)

+ 19
- 13
Marlin/src/lcd/ultralcd.cpp Переглянути файл

@@ -1751,9 +1751,15 @@ void kill_screen(const char* lcd_msg) {
1751 1751
      * If the queue is full, the command will fail, so we have to loop
1752 1752
      * with idle() to make sure the command has been enqueued.
1753 1753
      */
1754
-    void lcd_enqueue_command_sram(char * const cmd) {
1754
+    void lcd_enqueue_command(char * const cmd) {
1755 1755
       no_reentry = true;
1756
-      while (enqueue_and_echo_command(cmd)) idle();
1756
+      enqueue_and_echo_command_now(cmd);
1757
+      no_reentry = false;
1758
+    }
1759
+
1760
+    void lcd_enqueue_commands_P(const char * const cmd) {
1761
+      no_reentry = true;
1762
+      enqueue_and_echo_commands_P_now(cmd);
1757 1763
       no_reentry = false;
1758 1764
     }
1759 1765
 
@@ -2082,10 +2088,10 @@ void kill_screen(const char* lcd_msg) {
2082 2088
       enqueue_and_echo_commands_P(PSTR("G28"));
2083 2089
       #if HAS_TEMP_BED
2084 2090
         sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp);
2085
-        lcd_enqueue_command_sram(UBL_LCD_GCODE);
2091
+        lcd_enqueue_command(UBL_LCD_GCODE);
2086 2092
       #endif
2087 2093
       sprintf_P(UBL_LCD_GCODE, PSTR("M109 S%i"), custom_hotend_temp);
2088
-      lcd_enqueue_command_sram(UBL_LCD_GCODE);
2094
+      lcd_enqueue_command(UBL_LCD_GCODE);
2089 2095
       enqueue_and_echo_commands_P(PSTR("G29 P1"));
2090 2096
     }
2091 2097
 
@@ -2116,7 +2122,7 @@ void kill_screen(const char* lcd_msg) {
2116 2122
       const int ind = ubl_height_amount > 0 ? 9 : 10;
2117 2123
       strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -"));
2118 2124
       sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), abs(ubl_height_amount));
2119
-      lcd_enqueue_command_sram(UBL_LCD_GCODE);
2125
+      lcd_enqueue_command(UBL_LCD_GCODE);
2120 2126
     }
2121 2127
 
2122 2128
     /**
@@ -2167,8 +2173,8 @@ void kill_screen(const char* lcd_msg) {
2167 2173
         #endif
2168 2174
       ;
2169 2175
       sprintf_P(UBL_LCD_GCODE, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp);
2170
-      lcd_enqueue_command_sram("G28");
2171
-      lcd_enqueue_command_sram(UBL_LCD_GCODE);
2176
+      lcd_enqueue_commands_P(PSTR("G28"));
2177
+      lcd_enqueue_command(UBL_LCD_GCODE);
2172 2178
     }
2173 2179
 
2174 2180
     /**
@@ -2201,7 +2207,7 @@ void kill_screen(const char* lcd_msg) {
2201 2207
     void _lcd_ubl_grid_level_cmd() {
2202 2208
       char UBL_LCD_GCODE[10];
2203 2209
       sprintf_P(UBL_LCD_GCODE, PSTR("G29 J%i"), side_points);
2204
-      lcd_enqueue_command_sram(UBL_LCD_GCODE);
2210
+      lcd_enqueue_command(UBL_LCD_GCODE);
2205 2211
     }
2206 2212
 
2207 2213
     /**
@@ -2242,7 +2248,7 @@ void kill_screen(const char* lcd_msg) {
2242 2248
     void _lcd_ubl_fillin_amount_cmd() {
2243 2249
       char UBL_LCD_GCODE[16];
2244 2250
       sprintf_P(UBL_LCD_GCODE, PSTR("G29 P3 R C.%i"), ubl_fillin_amount);
2245
-      lcd_enqueue_command_sram(UBL_LCD_GCODE);
2251
+      lcd_enqueue_command(UBL_LCD_GCODE);
2246 2252
     }
2247 2253
 
2248 2254
     /**
@@ -2334,7 +2340,7 @@ void kill_screen(const char* lcd_msg) {
2334 2340
     void _lcd_ubl_load_mesh_cmd() {
2335 2341
       char UBL_LCD_GCODE[10];
2336 2342
       sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot);
2337
-      lcd_enqueue_command_sram(UBL_LCD_GCODE);
2343
+      lcd_enqueue_command(UBL_LCD_GCODE);
2338 2344
       enqueue_and_echo_commands_P(PSTR("M117 " MSG_MESH_LOADED "."));
2339 2345
     }
2340 2346
 
@@ -2344,7 +2350,7 @@ void kill_screen(const char* lcd_msg) {
2344 2350
     void _lcd_ubl_save_mesh_cmd() {
2345 2351
       char UBL_LCD_GCODE[10];
2346 2352
       sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot);
2347
-      lcd_enqueue_command_sram(UBL_LCD_GCODE);
2353
+      lcd_enqueue_command(UBL_LCD_GCODE);
2348 2354
       enqueue_and_echo_commands_P(PSTR("M117 " MSG_MESH_SAVED "."));
2349 2355
     }
2350 2356
 
@@ -2395,7 +2401,7 @@ void kill_screen(const char* lcd_msg) {
2395 2401
       dtostrf(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]), 0, 2, str);
2396 2402
       dtostrf(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]), 0, 2, str2);
2397 2403
       snprintf_P(UBL_LCD_GCODE, sizeof(UBL_LCD_GCODE), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts);
2398
-      lcd_enqueue_command_sram(UBL_LCD_GCODE);
2404
+      lcd_enqueue_command(UBL_LCD_GCODE);
2399 2405
     }
2400 2406
 
2401 2407
     /**
@@ -3290,7 +3296,7 @@ void kill_screen(const char* lcd_msg) {
3290 3296
           autotune_temp[e]
3291 3297
         #endif
3292 3298
       );
3293
-      lcd_enqueue_command_sram(cmd);
3299
+      lcd_enqueue_command(cmd);
3294 3300
     }
3295 3301
 
3296 3302
   #endif // PID_AUTOTUNE_MENU

+ 3
- 1
Marlin/src/module/configuration_store.cpp Переглянути файл

@@ -759,7 +759,9 @@ void MarlinSettings::postprocess() {
759 759
     }
760 760
     else {
761 761
       float dummy = 0;
762
-      bool dummyb;
762
+      #if DISABLED(AUTO_BED_LEVELING_UBL) || DISABLED(FWRETRACT)
763
+        bool dummyb;
764
+      #endif
763 765
 
764 766
       working_crc = 0;  // Init to 0. Accumulated by EEPROM_READ
765 767
 

+ 1
- 1
Marlin/src/sd/cardreader.cpp Переглянути файл

@@ -287,7 +287,7 @@ void CardReader::openAndPrintFile(const char *name) {
287 287
   char cmd[4 + strlen(name) + 1]; // Room for "M23 ", filename, and null
288 288
   sprintf_P(cmd, PSTR("M23 %s"), name);
289 289
   for (char *c = &cmd[4]; *c; c++) *c = tolower(*c);
290
-  enqueue_and_echo_command(cmd);
290
+  enqueue_and_echo_command_now(cmd);
291 291
   enqueue_and_echo_commands_P(PSTR("M24"));
292 292
 }
293 293
 

Завантаження…
Відмінити
Зберегти