Browse Source

Reduce string storage, use masking 'seen'

Scott Lahteine 4 years ago
parent
commit
665e45e0ba

+ 3
- 5
Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp View File

@@ -922,8 +922,7 @@ static void ee_Init() {
922 922
       if (!ee_IsPageClean(grp * PagesPerGroup + page)) {
923 923
         #ifdef EE_EMU_DEBUG
924 924
           SERIAL_ECHO_START();
925
-          SERIAL_ECHOPAIR("EEPROM Page ",page);
926
-          SERIAL_ECHOLNPAIR(" not clean on group ",grp);
925
+          SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on group ", grp);
927 926
           SERIAL_FLUSH();
928 927
         #endif
929 928
         ee_PageErase(grp * PagesPerGroup + page);
@@ -944,7 +943,7 @@ static void ee_Init() {
944 943
 
945 944
   #ifdef EE_EMU_DEBUG
946 945
     SERIAL_ECHO_START();
947
-    SERIAL_ECHOLNPAIR("EEPROM Active page: ",curPage);
946
+    SERIAL_ECHOLNPAIR("EEPROM Active page: ", curPage);
948 947
     SERIAL_FLUSH();
949 948
   #endif
950 949
 
@@ -953,8 +952,7 @@ static void ee_Init() {
953 952
     if (!ee_IsPageClean(curGroup * PagesPerGroup + page)) {
954 953
       #ifdef EE_EMU_DEBUG
955 954
         SERIAL_ECHO_START();
956
-        SERIAL_ECHOPAIR("EEPROM Page ",page);
957
-        SERIAL_ECHOLNPAIR(" not clean on active group ",curGroup);
955
+        SERIAL_ECHOLNPAIR("EEPROM Page ", page, " not clean on active group ", curGroup);
958 956
         SERIAL_FLUSH();
959 957
         ee_Dump(curGroup * PagesPerGroup + page, getFlashStorage(curGroup * PagesPerGroup + page));
960 958
       #endif

+ 5
- 4
Marlin/src/Marlin.cpp View File

@@ -962,10 +962,11 @@ void setup() {
962 962
   SERIAL_EOL();
963 963
 
964 964
   #if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR)
965
-    SERIAL_ECHO_START();
966
-    SERIAL_ECHOPGM(MSG_CONFIGURATION_VER);
967
-    SERIAL_ECHOPGM(STRING_DISTRIBUTION_DATE);
968
-    SERIAL_ECHOLNPGM(MSG_AUTHOR STRING_CONFIG_H_AUTHOR);
965
+    SERIAL_ECHO_MSG(
966
+      MSG_CONFIGURATION_VER
967
+      STRING_DISTRIBUTION_DATE
968
+      MSG_AUTHOR STRING_CONFIG_H_AUTHOR
969
+    );
969 970
     SERIAL_ECHO_MSG("Compiled: " __DATE__);
970 971
   #endif
971 972
 

+ 2
- 3
Marlin/src/feature/bedlevel/ubl/ubl.cpp View File

@@ -50,9 +50,8 @@
50 50
       for (uint8_t y = 0;  y < GRID_MAX_POINTS_Y; y++)
51 51
         if (!isnan(z_values[x][y])) {
52 52
           SERIAL_ECHO_START();
53
-          SERIAL_ECHOPAIR("  M421 I", x, " J", y);
54
-          SERIAL_ECHOPAIR_F(" Z", z_values[x][y], 4);
55
-          SERIAL_EOL();
53
+          SERIAL_ECHOPAIR("  M421 I", int(x), " J", int(y));
54
+          SERIAL_ECHOLNPAIR_F(" Z", z_values[x][y], 4);
56 55
           serial_delay(75); // Prevent Printrun from exploding
57 56
         }
58 57
   }

+ 1
- 3
Marlin/src/feature/prusa_MMU2/mmu2.cpp View File

@@ -432,9 +432,7 @@ bool MMU2::rx_ok() {
432 432
  */
433 433
 void MMU2::check_version() {
434 434
   if (buildnr < MMU_REQUIRED_FW_BUILDNR) {
435
-    SERIAL_ERROR_START();
436
-    SERIAL_ECHOPGM("MMU2 firmware version invalid. Required version >= ");
437
-    SERIAL_ECHOLN(MMU_REQUIRED_FW_BUILDNR);
435
+    SERIAL_ERROR_MSG("Invalid MMU2 firmware. Version >= " STRINGIFY(MMU_REQUIRED_FW_BUILDNR) " required.");
438 436
     kill(MSG_MMU2_WRONG_FIRMWARE);
439 437
   }
440 438
 }

+ 1
- 1
Marlin/src/gcode/bedlevel/M420.cpp View File

@@ -127,7 +127,7 @@ void GcodeSuite::M420() {
127 127
     }
128 128
 
129 129
     // L or V display the map info
130
-    if (parser.seen('L') || parser.seen('V')) {
130
+    if (parser.seen("LV")) {
131 131
       ubl.display_map(parser.byteval('T'));
132 132
       SERIAL_ECHOPGM("Mesh is ");
133 133
       if (!ubl.mesh_is_valid()) SERIAL_ECHOPGM("in");

+ 4
- 5
Marlin/src/gcode/config/M281.cpp View File

@@ -41,15 +41,14 @@ void GcodeSuite::M281() {
41 41
     }
42 42
     if (!angle_change) {
43 43
       SERIAL_ECHO_START();
44
-      SERIAL_ECHOPAIR(" Servo ", servo_index);
45
-      SERIAL_ECHOPAIR(" L", servo_angles[servo_index][0]);
46
-      SERIAL_ECHOLNPAIR(" U", servo_angles[servo_index][1]);
44
+      SERIAL_ECHOLNPAIR(" Servo ", servo_index,
45
+                        " L", servo_angles[servo_index][0],
46
+                        " U", servo_angles[servo_index][1]);
47 47
     }
48 48
   }
49 49
   else {
50 50
     SERIAL_ERROR_START();
51
-    SERIAL_ECHOPAIR("Servo ", servo_index);
52
-    SERIAL_ECHOLNPGM(" out of range");
51
+    SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range");
53 52
   }
54 53
 }
55 54
 

+ 3
- 3
Marlin/src/gcode/config/M301.cpp View File

@@ -61,9 +61,9 @@ void GcodeSuite::M301() {
61 61
     #if ENABLED(PID_PARAMS_PER_HOTEND)
62 62
       SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output
63 63
     #endif // PID_PARAMS_PER_HOTEND
64
-    SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, e));
65
-    SERIAL_ECHOPAIR(" i:", unscalePID_i(PID_PARAM(Ki, e)));
66
-    SERIAL_ECHOPAIR(" d:", unscalePID_d(PID_PARAM(Kd, e)));
64
+    SERIAL_ECHOPAIR(" p:", PID_PARAM(Kp, e),
65
+                    " i:", unscalePID_i(PID_PARAM(Ki, e)),
66
+                    " d:", unscalePID_d(PID_PARAM(Kd, e)));
67 67
     #if ENABLED(PID_EXTRUSION_SCALING)
68 68
       //Kc does not have scaling applied above, or in resetting defaults
69 69
       SERIAL_ECHOPAIR(" c:", PID_PARAM(Kc, e));

+ 1
- 2
Marlin/src/gcode/config/M302.cpp View File

@@ -56,8 +56,7 @@ void GcodeSuite::M302() {
56 56
     SERIAL_ECHO_START();
57 57
     SERIAL_ECHOPGM("Cold extrudes are ");
58 58
     serialprintPGM(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis"));
59
-    SERIAL_ECHOPAIR("abled (min temp ", thermalManager.extrude_min_temp);
60
-    SERIAL_ECHOLNPGM("C)");
59
+    SERIAL_ECHOLNPAIR("abled (min temp ", thermalManager.extrude_min_temp, "C)");
61 60
   }
62 61
 }
63 62
 

+ 3
- 3
Marlin/src/gcode/config/M304.cpp View File

@@ -33,9 +33,9 @@ void GcodeSuite::M304() {
33 33
   if (parser.seen('D')) thermalManager.temp_bed.pid.Kd = scalePID_d(parser.value_float());
34 34
 
35 35
   SERIAL_ECHO_START();
36
-  SERIAL_ECHOPAIR(" p:", thermalManager.temp_bed.pid.Kp);
37
-  SERIAL_ECHOPAIR(" i:", unscalePID_i(thermalManager.temp_bed.pid.Ki));
38
-  SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.temp_bed.pid.Kd));
36
+  SERIAL_ECHOLNPAIR(" p:", thermalManager.temp_bed.pid.Kp,
37
+                    " i:", unscalePID_i(thermalManager.temp_bed.pid.Ki),
38
+                    " d:", unscalePID_d(thermalManager.temp_bed.pid.Kd));
39 39
 }
40 40
 
41 41
 #endif // PIDTEMPBED

+ 7
- 9
Marlin/src/gcode/config/M92.cpp View File

@@ -25,9 +25,9 @@
25 25
 
26 26
 void report_M92(const bool echo=true, const int8_t e=-1) {
27 27
   if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' ');
28
-  SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]));
29
-  SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]));
30
-  SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]));
28
+  SERIAL_ECHOPAIR(" M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]),
29
+                  " Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]),
30
+                  " Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]));
31 31
   #if DISABLED(DISTINCT_E_FACTORS)
32 32
     SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS]));
33 33
   #endif
@@ -37,8 +37,8 @@ void report_M92(const bool echo=true, const int8_t e=-1) {
37 37
     for (uint8_t i = 0; i < E_STEPPERS; i++) {
38 38
       if (e >= 0 && i != e) continue;
39 39
       if (echo) SERIAL_ECHO_START(); else SERIAL_CHAR(' ');
40
-      SERIAL_ECHOPAIR(" M92 T", (int)i);
41
-      SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)]));
40
+      SERIAL_ECHOLNPAIR(" M92 T", (int)i,
41
+                        " E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS_N(i)]));
42 42
     }
43 43
   #endif
44 44
 
@@ -101,12 +101,10 @@ void GcodeSuite::M92() {
101 101
                      micro_steps = argH ? argH : Z_MICROSTEPS;
102 102
       const float z_full_step_mm = micro_steps * planner.steps_to_mm[Z_AXIS];
103 103
       SERIAL_ECHO_START();
104
-      SERIAL_ECHOPAIR("{ micro_steps:", micro_steps);
105
-      SERIAL_ECHOPAIR(", z_full_step_mm:", z_full_step_mm);
104
+      SERIAL_ECHOPAIR("{ micro_steps:", micro_steps, ", z_full_step_mm:", z_full_step_mm);
106 105
       if (wanted) {
107 106
         const float best = uint16_t(wanted / z_full_step_mm) * z_full_step_mm;
108
-        SERIAL_ECHOPGM(", best:[");
109
-        SERIAL_ECHO(best);
107
+        SERIAL_ECHOPAIR(", best:[", best);
110 108
         if (best != wanted) { SERIAL_CHAR(','); SERIAL_ECHO(best + z_full_step_mm); }
111 109
         SERIAL_CHAR(']');
112 110
       }

+ 2
- 4
Marlin/src/gcode/control/M280.cpp View File

@@ -43,14 +43,12 @@ void GcodeSuite::M280() {
43 43
     }
44 44
     else {
45 45
       SERIAL_ECHO_START();
46
-      SERIAL_ECHOPAIR(" Servo ", servo_index);
47
-      SERIAL_ECHOLNPAIR(": ", servo[servo_index].read());
46
+      SERIAL_ECHOLNPAIR(" Servo ", servo_index, ": ", servo[servo_index].read());
48 47
     }
49 48
   }
50 49
   else {
51 50
     SERIAL_ERROR_START();
52
-    SERIAL_ECHOPAIR("Servo ", servo_index);
53
-    SERIAL_ECHOLNPGM(" out of range");
51
+    SERIAL_ECHOLNPAIR("Servo ", servo_index, " out of range");
54 52
   }
55 53
 }
56 54
 

+ 1
- 1
Marlin/src/gcode/feature/L6470/M906.cpp View File

@@ -151,7 +151,7 @@ void L6470_report_current(L6470 &motor, const uint8_t axis) {
151 151
       break;
152 152
   }
153 153
   SERIAL_ECHO(dtostrf(val * 100 / 256, 10, 2, numstr));
154
-  SERIAL_ECHO("%% ");
154
+  SERIAL_ECHOPGM("%% ");
155 155
   serialprintPGM(suf);
156 156
   SERIAL_EOL();
157 157
 }

+ 4
- 4
Marlin/src/gcode/feature/advance/M900.cpp View File

@@ -99,13 +99,13 @@ void GcodeSuite::M900() {
99 99
 
100 100
     if (!parser.seen_any()) {
101 101
       #if EXTRUDERS < 2
102
-        SERIAL_ECHOLNPAIR("Advance S", ext_slot, " K", planner.extruder_advance_K[0]);
103
-        SERIAL_ECHOLNPAIR("(Slot ", 1 - ext_slot, " K", saved_extruder_advance_K[0], ")");
102
+        SERIAL_ECHOLNPAIR("Advance S", ext_slot, " K", planner.extruder_advance_K[0],
103
+                          "(Slot ", 1 - ext_slot, " K", saved_extruder_advance_K[0], ")");
104 104
       #else
105 105
         LOOP_L_N(i, EXTRUDERS) {
106 106
           const int slot = (int)TEST(lin_adv_slot, i);
107
-          SERIAL_ECHOLNPAIR("Advance T", int(i), " S", slot, " K", planner.extruder_advance_K[i]);
108
-          SERIAL_ECHOLNPAIR("(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")");
107
+          SERIAL_ECHOLNPAIR("Advance T", int(i), " S", slot, " K", planner.extruder_advance_K[i],
108
+                            "(Slot ", 1 - slot, " K", saved_extruder_advance_K[i], ")");
109 109
           SERIAL_EOL();
110 110
         }
111 111
       #endif

+ 1
- 1
Marlin/src/gcode/feature/powerloss/M413.cpp View File

@@ -47,7 +47,7 @@ void GcodeSuite::M413() {
47 47
   }
48 48
 
49 49
   #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
50
-    if (parser.seen('R') || parser.seen('L')) recovery.load();
50
+    if (parser.seen("RL")) recovery.load();
51 51
     if (parser.seen('W')) recovery.save(true);
52 52
     if (parser.seen('P')) recovery.purge();
53 53
     if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("PLR Exists\n") : PSTR("No PLR\n"));

+ 1
- 2
Marlin/src/gcode/probe/M951.cpp View File

@@ -28,11 +28,10 @@
28 28
 #include "../../module/tool_change.h"
29 29
 #include "../../module/motion.h"
30 30
 
31
-
32 31
 mpe_settings_t mpe_settings;
33 32
 
34 33
 inline void mpe_settings_report() {
35
-  SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Magnetic Parking Extruder");
34
+  SERIAL_ECHO_MSG("Magnetic Parking Extruder");
36 35
   SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("L: Left parking  :", mpe_settings.parking_xpos[0]);
37 36
   SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("R: Right parking :", mpe_settings.parking_xpos[1]);
38 37
   SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("I: Grab Offset   :", mpe_settings.grab_distance);

+ 8
- 9
Marlin/src/lcd/extensible_ui/lib/lulzbot/archim2-flash/flash_storage.cpp View File

@@ -178,7 +178,7 @@ bool UIFlashStorage::is_present = false;
178 178
         ((manufacturer_id == 0x1F) && (device_type == 0x86) && (capacity == 0x01)) ;  // Adesto AT255F161
179 179
 
180 180
     if (!is_known) {
181
-      SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Unable to locate supported SPI Flash Memory.");
181
+      SERIAL_ECHO_MSG("Unable to locate supported SPI Flash Memory.");
182 182
       SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("  Manufacturer ID, got: ", manufacturer_id);
183 183
       SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("  Device Type    , got: ", device_type);
184 184
       SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("  Capacity       , got: ", capacity);
@@ -252,7 +252,7 @@ bool UIFlashStorage::is_present = false;
252 252
           return -1;
253 253
       }
254 254
     }
255
-    SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("No LULZ delimiter found.");
255
+    SERIAL_ECHO_MSG("No LULZ delimiter found.");
256 256
     return -1;
257 257
   }
258 258
 
@@ -264,7 +264,7 @@ bool UIFlashStorage::is_present = false;
264 264
 
265 265
     int32_t write_offset = read_offset + 4 + block_size;
266 266
     if ((write_offset + 4 + block_size) > data_storage_area_size) {
267
-      SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Not enough free space in Flash.");
267
+      SERIAL_ECHO_MSG("Not enough free space in Flash.");
268 268
       return -1; // Not enough free space
269 269
     }
270 270
     return write_offset;
@@ -300,7 +300,7 @@ bool UIFlashStorage::is_present = false;
300 300
 
301 301
   void UIFlashStorage::write_config_data(const void *data, size_t size) {
302 302
     if (!is_present) {
303
-      SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("SPI Flash chip not present. Not saving UI settings.");
303
+      SERIAL_ECHO_MSG("SPI Flash chip not present. Not saving UI settings.");
304 304
       return;
305 305
     }
306 306
 
@@ -308,7 +308,7 @@ bool UIFlashStorage::is_present = false;
308 308
     // make sure that the data is different before rewriting.
309 309
 
310 310
     if (verify_config_data(data, size)) {
311
-      SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("UI settings already written, skipping write.");
311
+      SERIAL_ECHO_MSG("UI settings already written, skipping write.");
312 312
       return;
313 313
     }
314 314
 
@@ -427,12 +427,12 @@ bool UIFlashStorage::is_present = false;
427 427
 
428 428
       MediaFileReader reader;
429 429
       if (!reader.open((char*) buff)) {
430
-        SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Unable to find media file");
430
+        SERIAL_ECHO_MSG("Unable to find media file");
431 431
         return FILE_NOT_FOUND;
432 432
       }
433 433
 
434 434
       if (get_media_file_size(slot) != 0xFFFFFFFFUL) {
435
-        SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Media file already exists");
435
+        SERIAL_ECHO_MSG("Media file already exists");
436 436
         return WOULD_OVERWRITE;
437 437
       }
438 438
 
@@ -518,9 +518,8 @@ bool UIFlashStorage::is_present = false;
518 518
       SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Boot media file size:", bytes_remaining);
519 519
       addr = get_media_file_start(slot);
520 520
       return true;
521
-    } else {
522
-      return false;
523 521
     }
522
+    return false;
524 523
   }
525 524
 
526 525
   int16_t UIFlashStorage::BootMediaReader::read(void *data, const size_t size) {

+ 4
- 6
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/commands.cpp View File

@@ -923,8 +923,7 @@ template <class T> bool CLCD::CommandFifo::_write_unaligned(T data, uint16_t len
923 923
 
924 924
   #if ENABLED(TOUCH_UI_DEBUG)
925 925
   if (command_write_ptr == 0xFFFFFFFFul) {
926
-    SERIAL_ECHO_START();
927
-    SERIAL_ECHOLNPGM("Attempt to write to FIFO before CommandFifo::Cmd_Start().");
926
+    SERIAL_ECHO_MSG("Attempt to write to FIFO before CommandFifo::Cmd_Start().");
928 927
   }
929 928
   #endif
930 929
 
@@ -1016,8 +1015,8 @@ template <class T> bool CLCD::CommandFifo::write(T data, uint16_t len) {
1016 1015
   if (Command_Space < (len + padding)) {
1017 1016
     #if ENABLED(TOUCH_UI_DEBUG)
1018 1017
       SERIAL_ECHO_START();
1019
-      SERIAL_ECHOPAIR("Waiting for ", len + padding);
1020
-      SERIAL_ECHOPAIR(" bytes in command queue, now free: ", Command_Space);
1018
+      SERIAL_ECHOPAIR("Waiting for ", len + padding,
1019
+                      " bytes in command queue, now free: ", Command_Space);
1021 1020
     #endif
1022 1021
     do {
1023 1022
       Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF;
@@ -1071,8 +1070,7 @@ void CLCD::init() {
1071 1070
    uint8_t device_id = mem_read_8(REG::ID);            // Read Device ID, Should Be 0x7C;
1072 1071
    if (device_id == 0x7c) {
1073 1072
      #if ENABLED(TOUCH_UI_DEBUG)
1074
-       SERIAL_ECHO_START();
1075
-       SERIAL_ECHOLNPGM("FTDI chip initialized ");
1073
+       SERIAL_ECHO_MSG("FTDI chip initialized ");
1076 1074
      #endif
1077 1075
      break;
1078 1076
    }

+ 3
- 3
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/basic/constants.h View File

@@ -148,7 +148,7 @@ namespace FTDI {
148 148
   constexpr uint8_t STENCIL_OP_DECR                    = 4;
149 149
   constexpr uint8_t STENCIL_OP_INVERT                  = 5;
150 150
 
151
-  typedef enum: uint32_t {
151
+  typedef enum : uint32_t {
152 152
    BITMAPS                                             = 1,
153 153
    POINTS                                              = 2,
154 154
    LINES                                               = 3,
@@ -281,7 +281,7 @@ namespace FTDI_FT810 {
281 281
 }
282 282
 
283 283
 namespace FTDI {
284
-  enum effect_t {
284
+  enum effect_t : unsigned char {
285 285
     SILENCE                                         = 0x00,
286 286
     SQUARE_WAVE                                     = 0x01,
287 287
     SINE_WAVE                                       = 0x02,
@@ -342,7 +342,7 @@ namespace FTDI {
342 342
     UNMUTE                                          = 0x61
343 343
   };
344 344
 
345
-  enum note_t {
345
+  enum note_t : unsigned char {
346 346
     END_SONG                                        = 0xFF,
347 347
     REST                                            = 0x00,
348 348
 

+ 7
- 8
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/dl_cache.cpp View File

@@ -78,8 +78,7 @@ bool DLCache::wait_until_idle() {
78 78
   const unsigned long startTime = millis();
79 79
   do {
80 80
     if ((millis() - startTime) > 250) {
81
-      SERIAL_ECHO_START();
82
-      SERIAL_ECHOLNPGM("Timeout on DL_Cache::Wait_Until_Idle()");
81
+      SERIAL_ECHO_MSG("Timeout on DL_Cache::Wait_Until_Idle()");
83 82
       CLCD::CommandFifo::reset();
84 83
       return false;
85 84
     }
@@ -130,15 +129,15 @@ bool DLCache::store(uint32_t num_bytes /* = 0*/) {
130 129
     // Not enough memory to cache the display list.
131 130
     #if ENABLED(TOUCH_UI_DEBUG)
132 131
       SERIAL_ECHO_START();
133
-      SERIAL_ECHOPAIR("Not enough space in GRAM to cache display list, free space: ", free_space);
134
-      SERIAL_ECHOLNPAIR(" Required: ", dl_size);
132
+      SERIAL_ECHOLNPAIR("Not enough space in GRAM to cache display list, free space: ", free_space,
133
+                        " Required: ", dl_size);
135 134
     #endif
136 135
     return false;
137 136
   } else {
138 137
     #if ENABLED(TOUCH_UI_DEBUG)
139 138
       SERIAL_ECHO_START();
140
-      SERIAL_ECHOPAIR("Saving DL to RAMG cache, bytes: ", dl_size);
141
-      SERIAL_ECHOLNPAIR(" Free space: ", free_space);
139
+      SERIAL_ECHOLNPAIR("Saving DL to RAMG cache, bytes: ", dl_size,
140
+                        " Free space: ", free_space);
142 141
     #endif
143 142
     cmd.memcpy(dl_addr, MAP::RAM_DL, dl_size);
144 143
     cmd.execute();
@@ -168,8 +167,8 @@ void DLCache::append() {
168 167
     cmd.execute();
169 168
     wait_until_idle();
170 169
     SERIAL_ECHO_START();
171
-    SERIAL_ECHOPAIR("Appending to DL from RAMG cache, bytes: ", dl_size);
172
-    SERIAL_ECHOLNPAIR(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL));
170
+    SERIAL_ECHOLNPAIR("Appending to DL from RAMG cache, bytes: ", dl_size,
171
+                      " REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL));
173 172
   #endif
174 173
 }
175 174
 

+ 1
- 2
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/screen_types.h View File

@@ -176,8 +176,7 @@ class CachedScreen {
176 176
     static bool storeBackground() {
177 177
       DLCache dlcache(DL_SLOT);
178 178
       if (!dlcache.store(DL_SIZE)) {
179
-        SERIAL_ECHO_START();
180
-        SERIAL_ECHOLNPGM("CachedScreen::storeBackground() failed: not enough DL cache space");
179
+        SERIAL_ECHO_MSG("CachedScreen::storeBackground() failed: not enough DL cache space");
181 180
         return false;
182 181
       }
183 182
       return true;

+ 1
- 2
Marlin/src/lcd/extensible_ui/lib/lulzbot/ftdi_eve_lib/extended/sound_player.cpp View File

@@ -38,8 +38,7 @@ namespace FTDI {
38 38
 
39 39
     #if ENABLED(TOUCH_UI_DEBUG)
40 40
       SERIAL_ECHO_START();
41
-      SERIAL_ECHOPAIR("Playing note ", note);
42
-      SERIAL_ECHOLNPAIR(", instrument ", effect);
41
+      SERIAL_ECHOLNPAIR("Playing note ", int(note), ", instrument ", int(effect));
43 42
     #endif
44 43
 
45 44
     // Play the note

+ 4
- 8
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/media_player_screen.cpp View File

@@ -66,8 +66,7 @@ bool MediaPlayerScreen::playCardMedia() {
66 66
     if (!reader.open(fname))
67 67
       return false;
68 68
 
69
-    SERIAL_ECHO_START();
70
-    SERIAL_ECHOLNPGM("Starting to play STARTUP.AVI");
69
+    SERIAL_ECHO_MSG("Starting to play STARTUP.AVI");
71 70
     playStream(&reader, MediaFileReader::read);
72 71
     reader.close();
73 72
   #endif
@@ -79,8 +78,7 @@ bool MediaPlayerScreen::playBootMedia() {
79 78
   UIFlashStorage::BootMediaReader reader;
80 79
   if (!reader.isAvailable()) return false;
81 80
 
82
-  SERIAL_ECHO_START();
83
-  SERIAL_ECHOLNPGM("Starting to play boot video");
81
+  SERIAL_ECHO_MSG("Starting to play boot video");
84 82
   playStream(&reader, UIFlashStorage::BootMediaReader::read);
85 83
   return true;
86 84
 }
@@ -138,8 +136,7 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream
138 136
             t = millis();
139 137
             timeouts--;
140 138
             if (timeouts == 0) {
141
-              SERIAL_ECHO_START();
142
-              SERIAL_ECHOLNPGM("Timeout playing video");
139
+              SERIAL_ECHO_MSG("Timeout playing video");
143 140
               cmd.reset();
144 141
               goto exit;
145 142
             }
@@ -151,8 +148,7 @@ void MediaPlayerScreen::playStream(void *obj, media_streamer_func_t *data_stream
151 148
         CLCD::mem_write_32(CLCD::REG::MEDIAFIFO_WRITE, writePtr);
152 149
       } while (nBytes == block_size);
153 150
 
154
-      SERIAL_ECHO_START();
155
-      SERIAL_ECHOLNPGM("Done playing video");
151
+      SERIAL_ECHO_MSG("Done playing video");
156 152
 
157 153
     exit:
158 154
       spiInit(SPI_SPEED); // Restore default speed

+ 1
- 2
Marlin/src/lcd/extensible_ui/lib/lulzbot/screens/touch_calibration_screen.cpp View File

@@ -52,8 +52,7 @@ void TouchCalibrationScreen::onEntry() {
52 52
 
53 53
     while (CLCD::is_touching()) {
54 54
       #if ENABLED(TOUCH_UI_DEBUG)
55
-        SERIAL_ECHO_START();
56
-        SERIAL_ECHOLNPGM("Waiting for touch release");
55
+        SERIAL_ECHO_MSG("Waiting for touch release");
57 56
       #endif
58 57
     }
59 58
   }

+ 2
- 4
Marlin/src/sd/cardreader.cpp View File

@@ -192,8 +192,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
192 192
       if (!dir.open(&parent, dosFilename, O_READ)) {
193 193
         if (lsAction == LS_SerialPrint) {
194 194
           SERIAL_ECHO_START();
195
-          SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
196
-          SERIAL_ECHOLN(dosFilename);
195
+          SERIAL_ECHOLNPAIR(MSG_SD_CANT_OPEN_SUBDIR, dosFilename);
197 196
         }
198 197
       }
199 198
       lsDive(path, dir);
@@ -292,8 +291,7 @@ void CardReader::ls() {
292 291
       if (!dir.open(&diveDir, segment, O_READ)) {
293 292
         SERIAL_EOL();
294 293
         SERIAL_ECHO_START();
295
-        SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR);
296
-        SERIAL_ECHO(segment);
294
+        SERIAL_ECHOPAIR(MSG_SD_CANT_OPEN_SUBDIR, segment);
297 295
         break;
298 296
       }
299 297
 

Loading…
Cancel
Save