Ver código fonte

Tweak parser warning

Scott Lahteine 4 anos atrás
pai
commit
38873596ec

+ 2
- 3
Marlin/src/core/serial.h Ver arquivo

@@ -260,8 +260,8 @@ extern uint8_t marlin_debug_flags;
260 260
 #define SERIAL_ERROR_START()        serial_error_start()
261 261
 #define SERIAL_EOL()                SERIAL_CHAR('\n')
262 262
 
263
-#define SERIAL_ECHO_MSG(S)          do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(S); }while(0)
264
-#define SERIAL_ERROR_MSG(S)         do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(S); }while(0)
263
+#define SERIAL_ECHO_MSG(V...)       do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(V); }while(0)
264
+#define SERIAL_ERROR_MSG(V...)      do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(V); }while(0)
265 265
 
266 266
 #define SERIAL_ECHO_SP(C)           serial_spaces(C)
267 267
 
@@ -292,7 +292,6 @@ void serialprint_truefalse(const bool tf);
292 292
 void serial_spaces(uint8_t count);
293 293
 
294 294
 void print_bin(const uint16_t val);
295
-
296 295
 void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr);
297 296
 
298 297
 inline void print_xyz(const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr) {

+ 3
- 3
Marlin/src/gcode/gcode.cpp Ver arquivo

@@ -353,7 +353,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
353 353
         case 800: parser.debug(); break;                          // G800: GCode Parser Test for G
354 354
       #endif
355 355
 
356
-      default: parser.unknown_command_error(); break;
356
+      default: parser.unknown_command_warning(); break;
357 357
     }
358 358
     break;
359 359
 
@@ -856,7 +856,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
856 856
         case 7219: M7219(); break;                                // M7219: Set LEDs, columns, and rows
857 857
       #endif
858 858
 
859
-      default: parser.unknown_command_error(); break;
859
+      default: parser.unknown_command_warning(); break;
860 860
     }
861 861
     break;
862 862
 
@@ -866,7 +866,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
866 866
       #if ENABLED(WIFI_CUSTOM_COMMAND)
867 867
         if (wifi_custom_command(parser.command_ptr)) break;
868 868
       #endif
869
-      parser.unknown_command_error();
869
+      parser.unknown_command_warning();
870 870
   }
871 871
 
872 872
   if (!no_ok) queue.ok_to_send();

+ 6
- 4
Marlin/src/gcode/parser.cpp Ver arquivo

@@ -333,9 +333,8 @@ void GCodeParser::parse(char *p) {
333 333
 
334 334
 #endif // CNC_COORDINATE_SYSTEMS
335 335
 
336
-void GCodeParser::unknown_command_error() {
337
-  SERIAL_ECHO_START();
338
-  SERIAL_ECHOLNPAIR(MSG_UNKNOWN_COMMAND, command_ptr, "\"");
336
+void GCodeParser::unknown_command_warning() {
337
+  SERIAL_ECHO_MSG(MSG_UNKNOWN_COMMAND, command_ptr, "\"");
339 338
 }
340 339
 
341 340
 #if ENABLED(DEBUG_GCODE_PARSER)
@@ -351,7 +350,10 @@ void GCodeParser::unknown_command_error() {
351 350
     #else
352 351
       SERIAL_ECHOPAIR(" args: { ", command_args, " }");
353 352
     #endif
354
-    if (string_arg) SERIAL_ECHOPAIR(" string: \"", string_arg, "\"");
353
+    if (string_arg) {
354
+      SERIAL_ECHOPAIR(" string: \"", string_arg);
355
+      SERIAL_CHAR('"');
356
+    }
355 357
     SERIAL_ECHOLNPGM("\n");
356 358
     for (char c = 'A'; c <= 'Z'; ++c) {
357 359
       if (seen(c)) {

+ 1
- 1
Marlin/src/gcode/parser.h Ver arquivo

@@ -366,7 +366,7 @@ public:
366 366
 
367 367
   static inline feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); }
368 368
 
369
-  void unknown_command_error();
369
+  void unknown_command_warning();
370 370
 
371 371
   // Provide simple value accessors with default option
372 372
   static inline float    floatval(const char c, const float dval=0.0)   { return seenval(c) ? value_float()        : dval; }

Carregando…
Cancelar
Salvar