Merge pull request #4161 from thinkyhead/rc_general_cleanup
Reduce storage requirements for strings, make some PGM
This commit is contained in:
		
						commit
						db19959735
					
				| @ -86,7 +86,7 @@ void gcode_M100() { | |||||||
|     sp = top_of_stack(); |     sp = top_of_stack(); | ||||||
|     SERIAL_ECHOPGM("\nStack Pointer : "); |     SERIAL_ECHOPGM("\nStack Pointer : "); | ||||||
|     prt_hex_word((unsigned int) sp); |     prt_hex_word((unsigned int) sp); | ||||||
|     SERIAL_ECHOPGM("\n"); |     SERIAL_EOL; | ||||||
|     sp = (unsigned char*)((unsigned long) sp | 0x000f); |     sp = (unsigned char*)((unsigned long) sp | 0x000f); | ||||||
|     n = sp - ptr; |     n = sp - ptr; | ||||||
|     //
 |     //
 | ||||||
| @ -94,25 +94,25 @@ void gcode_M100() { | |||||||
|     //
 |     //
 | ||||||
|     while (ptr < sp) { |     while (ptr < sp) { | ||||||
|       prt_hex_word((unsigned int) ptr); // Print the address
 |       prt_hex_word((unsigned int) ptr); // Print the address
 | ||||||
|       SERIAL_ECHOPGM(":"); |       SERIAL_CHAR(':'); | ||||||
|       for (i = 0; i < 16; i++) {      // and 16 data bytes
 |       for (i = 0; i < 16; i++) {      // and 16 data bytes
 | ||||||
|         prt_hex_byte(*(ptr + i)); |         prt_hex_byte(*(ptr + i)); | ||||||
|         SERIAL_ECHOPGM(" "); |         SERIAL_CHAR(' '); | ||||||
|         delay(2); |         delay(2); | ||||||
|       } |       } | ||||||
|       SERIAL_ECHO("|");         // now show where non 0xE5's are
 |       SERIAL_CHAR('|');         // now show where non 0xE5's are
 | ||||||
|       for (i = 0; i < 16; i++) { |       for (i = 0; i < 16; i++) { | ||||||
|         delay(2); |         delay(2); | ||||||
|         if (*(ptr + i) == 0xe5) |         if (*(ptr + i) == 0xe5) | ||||||
|           SERIAL_ECHOPGM(" "); |           SERIAL_CHAR(' '); | ||||||
|         else |         else | ||||||
|           SERIAL_ECHOPGM("?"); |           SERIAL_CHAR('?'); | ||||||
|       } |       } | ||||||
|       SERIAL_ECHO("\n"); |       SERIAL_EOL; | ||||||
|       ptr += 16; |       ptr += 16; | ||||||
|       delay(2); |       delay(2); | ||||||
|     } |     } | ||||||
|     SERIAL_ECHOLNPGM("Done.\n"); |     SERIAL_ECHOLNPGM("Done."); | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
| #endif | #endif | ||||||
| @ -137,7 +137,7 @@ void gcode_M100() { | |||||||
|           SERIAL_ECHOPAIR("Found ", j); |           SERIAL_ECHOPAIR("Found ", j); | ||||||
|           SERIAL_ECHOPGM(" bytes free at 0x"); |           SERIAL_ECHOPGM(" bytes free at 0x"); | ||||||
|           prt_hex_word((int) ptr + i); |           prt_hex_word((int) ptr + i); | ||||||
|           SERIAL_ECHOPGM("\n"); |           SERIAL_EOL; | ||||||
|           i += j; |           i += j; | ||||||
|           block_cnt++; |           block_cnt++; | ||||||
|         } |         } | ||||||
| @ -150,8 +150,8 @@ void gcode_M100() { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     if (block_cnt > 1) |     if (block_cnt > 1) | ||||||
|       SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area.\n"); |       SERIAL_ECHOLNPGM("\nMemory Corruption detected in free memory area."); | ||||||
|     SERIAL_ECHO("\nDone.\n"); |     SERIAL_ECHOLNPGM("\nDone."); | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   //
 |   //
 | ||||||
| @ -173,7 +173,7 @@ void gcode_M100() { | |||||||
|     j = n / (x + 1); |     j = n / (x + 1); | ||||||
|     for (i = 1; i <= x; i++) { |     for (i = 1; i <= x; i++) { | ||||||
|       *(ptr + (i * j)) = i; |       *(ptr + (i * j)) = i; | ||||||
|       SERIAL_ECHO("\nCorrupting address: 0x"); |       SERIAL_ECHOPGM("\nCorrupting address: 0x"); | ||||||
|       prt_hex_word((unsigned int)(ptr + (i * j))); |       prt_hex_word((unsigned int)(ptr + (i * j))); | ||||||
|     } |     } | ||||||
|     SERIAL_ECHOLNPGM("\n"); |     SERIAL_ECHOLNPGM("\n"); | ||||||
|  | |||||||
| @ -84,8 +84,9 @@ typedef unsigned long millis_t; | |||||||
| #define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y) | #define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y) | ||||||
| #define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)) | #define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)) | ||||||
| #define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x); SERIAL_EOL; }while(0) | #define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x); SERIAL_EOL; }while(0) | ||||||
| #define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)); SERIAL_EOL; }while(0) | #define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x "\n")); }while(0) | ||||||
| 
 | 
 | ||||||
|  | #define SERIAL_PROTOCOLPAIR(name, value) SERIAL_ECHOPAIR(name, value) | ||||||
| 
 | 
 | ||||||
| extern const char errormagic[] PROGMEM; | extern const char errormagic[] PROGMEM; | ||||||
| extern const char echomagic[] PROGMEM; | extern const char echomagic[] PROGMEM; | ||||||
|  | |||||||
| @ -1442,8 +1442,8 @@ static void set_home_offset(AxisEnum axis, float v) { | |||||||
| static void set_axis_is_at_home(AxisEnum axis) { | static void set_axis_is_at_home(AxisEnum axis) { | ||||||
|   #if ENABLED(DEBUG_LEVELING_FEATURE) |   #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|     if (DEBUGGING(LEVELING)) { |     if (DEBUGGING(LEVELING)) { | ||||||
|       SERIAL_ECHOPAIR("set_axis_is_at_home(", axis); |       SERIAL_ECHOPAIR(">>> set_axis_is_at_home(", axis); | ||||||
|       SERIAL_ECHOLNPGM(") >>>"); |       SERIAL_ECHOLNPGM(")"); | ||||||
|     } |     } | ||||||
|   #endif |   #endif | ||||||
| 
 | 
 | ||||||
| @ -1993,7 +1993,7 @@ static void clean_up_after_endstop_or_probe_move() { | |||||||
|       long start_steps = stepper.position(Z_AXIS); |       long start_steps = stepper.position(Z_AXIS); | ||||||
| 
 | 
 | ||||||
|       #if ENABLED(DEBUG_LEVELING_FEATURE) |       #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("run_z_probe (DELTA) 1"); |         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 1", current_position); | ||||||
|       #endif |       #endif | ||||||
| 
 | 
 | ||||||
|       // move down slowly until you find the bed
 |       // move down slowly until you find the bed
 | ||||||
| @ -2015,8 +2015,6 @@ static void clean_up_after_endstop_or_probe_move() { | |||||||
|         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position); |         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe (DELTA) 2", current_position); | ||||||
|       #endif |       #endif | ||||||
| 
 | 
 | ||||||
|       SYNC_PLAN_POSITION_KINEMATIC(); |  | ||||||
| 
 |  | ||||||
|     #else // !DELTA
 |     #else // !DELTA
 | ||||||
| 
 | 
 | ||||||
|       #if ENABLED(AUTO_BED_LEVELING_FEATURE) |       #if ENABLED(AUTO_BED_LEVELING_FEATURE) | ||||||
| @ -2054,14 +2052,14 @@ static void clean_up_after_endstop_or_probe_move() { | |||||||
|       // Get the current stepper position after bumping an endstop
 |       // Get the current stepper position after bumping an endstop
 | ||||||
|       current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); |       current_position[Z_AXIS] = stepper.get_axis_position_mm(Z_AXIS); | ||||||
| 
 | 
 | ||||||
|       SYNC_PLAN_POSITION_KINEMATIC(); |  | ||||||
| 
 |  | ||||||
|       #if ENABLED(DEBUG_LEVELING_FEATURE) |       #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position); |         if (DEBUGGING(LEVELING)) DEBUG_POS("run_z_probe", current_position); | ||||||
|       #endif |       #endif | ||||||
| 
 | 
 | ||||||
|     #endif // !DELTA
 |     #endif // !DELTA
 | ||||||
| 
 | 
 | ||||||
|  |     SYNC_PLAN_POSITION_KINEMATIC(); | ||||||
|  | 
 | ||||||
|     feedrate = old_feedrate; |     feedrate = old_feedrate; | ||||||
| 
 | 
 | ||||||
|     return current_position[Z_AXIS]; |     return current_position[Z_AXIS]; | ||||||
| @ -2083,9 +2081,10 @@ static void clean_up_after_endstop_or_probe_move() { | |||||||
|   static float probe_pt(float x, float y, bool stow = true, int verbose_level = 1) { |   static float probe_pt(float x, float y, bool stow = true, int verbose_level = 1) { | ||||||
|     #if ENABLED(DEBUG_LEVELING_FEATURE) |     #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|       if (DEBUGGING(LEVELING)) { |       if (DEBUGGING(LEVELING)) { | ||||||
|         SERIAL_ECHOLNPGM("probe_pt >>>"); |         SERIAL_ECHOPAIR(">>> probe_pt(", x); | ||||||
|         SERIAL_ECHOPAIR("> stow:", stow); |         SERIAL_ECHOPAIR(", ", y); | ||||||
|         SERIAL_EOL; |         SERIAL_ECHOPAIR(", ", stow ? "stow" : "no stow"); | ||||||
|  |         SERIAL_ECHOLNPGM(")"); | ||||||
|         DEBUG_POS("", current_position); |         DEBUG_POS("", current_position); | ||||||
|       } |       } | ||||||
|     #endif |     #endif | ||||||
| @ -2107,7 +2106,7 @@ static void clean_up_after_endstop_or_probe_move() { | |||||||
|     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); |     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER)); | ||||||
| 
 | 
 | ||||||
|     #if ENABLED(DEBUG_LEVELING_FEATURE) |     #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> deploy_z_probe"); |       if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); | ||||||
|     #endif |     #endif | ||||||
|     deploy_z_probe(); |     deploy_z_probe(); | ||||||
| 
 | 
 | ||||||
| @ -2115,7 +2114,7 @@ static void clean_up_after_endstop_or_probe_move() { | |||||||
| 
 | 
 | ||||||
|     if (stow) { |     if (stow) { | ||||||
|       #if ENABLED(DEBUG_LEVELING_FEATURE) |       #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> stow_z_probe"); |         if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); | ||||||
|       #endif |       #endif | ||||||
|       stow_z_probe(); |       stow_z_probe(); | ||||||
|     } |     } | ||||||
| @ -2329,7 +2328,7 @@ static void homeaxis(AxisEnum axis) { | |||||||
|     #if HAS_BED_PROBE |     #if HAS_BED_PROBE | ||||||
|       if (axis == Z_AXIS && axis_home_dir < 0) { |       if (axis == Z_AXIS && axis_home_dir < 0) { | ||||||
|         #if ENABLED(DEBUG_LEVELING_FEATURE) |         #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|           if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > deploy_z_probe()"); |           if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); | ||||||
|         #endif |         #endif | ||||||
|         deploy_z_probe(); |         deploy_z_probe(); | ||||||
|       } |       } | ||||||
| @ -2453,7 +2452,7 @@ static void homeaxis(AxisEnum axis) { | |||||||
|     #if HAS_BED_PROBE |     #if HAS_BED_PROBE | ||||||
|       if (axis == Z_AXIS && axis_home_dir < 0) { |       if (axis == Z_AXIS && axis_home_dir < 0) { | ||||||
|         #if ENABLED(DEBUG_LEVELING_FEATURE) |         #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|           if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(" > stow_z_probe()"); |           if (DEBUGGING(LEVELING)) SERIAL_ECHOPGM("> "); | ||||||
|         #endif |         #endif | ||||||
|         stow_z_probe(); |         stow_z_probe(); | ||||||
|       } |       } | ||||||
| @ -2543,7 +2542,7 @@ void unknown_command_error() { | |||||||
|   SERIAL_ECHO_START; |   SERIAL_ECHO_START; | ||||||
|   SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND); |   SERIAL_ECHOPGM(MSG_UNKNOWN_COMMAND); | ||||||
|   SERIAL_ECHO(current_command); |   SERIAL_ECHO(current_command); | ||||||
|   SERIAL_ECHOPGM("\"\n"); |   SERIAL_ECHOLNPGM("\""); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #if ENABLED(HOST_KEEPALIVE_FEATURE) | #if ENABLED(HOST_KEEPALIVE_FEATURE) | ||||||
| @ -2741,7 +2740,7 @@ inline void gcode_G4() { | |||||||
| inline void gcode_G28() { | inline void gcode_G28() { | ||||||
| 
 | 
 | ||||||
|   #if ENABLED(DEBUG_LEVELING_FEATURE) |   #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("gcode_G28 >>>"); |     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM(">>> gcode_G28"); | ||||||
|   #endif |   #endif | ||||||
| 
 | 
 | ||||||
|   // Wait for planner moves to finish!
 |   // Wait for planner moves to finish!
 | ||||||
| @ -3187,19 +3186,11 @@ inline void gcode_G28() { | |||||||
|     switch (state) { |     switch (state) { | ||||||
|       case MeshReport: |       case MeshReport: | ||||||
|         if (mbl.has_mesh()) { |         if (mbl.has_mesh()) { | ||||||
|           SERIAL_PROTOCOLPGM("State: "); |           SERIAL_PROTOCOLPAIR("State: ", mbl.active() ? "On" : "Off"); | ||||||
|           if (mbl.active()) |           SERIAL_PROTOCOLPAIR("\nNum X,Y: ", MESH_NUM_X_POINTS); | ||||||
|             SERIAL_PROTOCOLPGM("On"); |           SERIAL_PROTOCOLCHAR(','); SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); | ||||||
|           else |           SERIAL_PROTOCOLPAIR("\nZ search height: ", MESH_HOME_SEARCH_Z); | ||||||
|             SERIAL_PROTOCOLPGM("Off"); |           SERIAL_PROTOCOLPGM("\nZ offset: "); SERIAL_PROTOCOL_F(mbl.z_offset, 5); | ||||||
|           SERIAL_PROTOCOLPGM("\nNum X,Y: "); |  | ||||||
|           SERIAL_PROTOCOL(MESH_NUM_X_POINTS); |  | ||||||
|           SERIAL_PROTOCOLCHAR(','); |  | ||||||
|           SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); |  | ||||||
|           SERIAL_PROTOCOLPGM("\nZ search height: "); |  | ||||||
|           SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z); |  | ||||||
|           SERIAL_PROTOCOLPGM("\nZ offset: "); |  | ||||||
|           SERIAL_PROTOCOL_F(mbl.z_offset, 5); |  | ||||||
|           SERIAL_PROTOCOLLNPGM("\nMeasured points:"); |           SERIAL_PROTOCOLLNPGM("\nMeasured points:"); | ||||||
|           for (py = 0; py < MESH_NUM_Y_POINTS; py++) { |           for (py = 0; py < MESH_NUM_Y_POINTS; py++) { | ||||||
|             for (px = 0; px < MESH_NUM_X_POINTS; px++) { |             for (px = 0; px < MESH_NUM_X_POINTS; px++) { | ||||||
| @ -3268,30 +3259,30 @@ inline void gcode_G28() { | |||||||
|         if (code_seen('X')) { |         if (code_seen('X')) { | ||||||
|           px = code_value_int() - 1; |           px = code_value_int() - 1; | ||||||
|           if (px < 0 || px >= MESH_NUM_X_POINTS) { |           if (px < 0 || px >= MESH_NUM_X_POINTS) { | ||||||
|             SERIAL_PROTOCOLPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ").\n"); |             SERIAL_PROTOCOLLNPGM("X out of range (1-" STRINGIFY(MESH_NUM_X_POINTS) ")."); | ||||||
|             return; |             return; | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|           SERIAL_PROTOCOLPGM("X not entered.\n"); |           SERIAL_PROTOCOLLNPGM("X not entered."); | ||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|         if (code_seen('Y')) { |         if (code_seen('Y')) { | ||||||
|           py = code_value_int() - 1; |           py = code_value_int() - 1; | ||||||
|           if (py < 0 || py >= MESH_NUM_Y_POINTS) { |           if (py < 0 || py >= MESH_NUM_Y_POINTS) { | ||||||
|             SERIAL_PROTOCOLPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ").\n"); |             SERIAL_PROTOCOLLNPGM("Y out of range (1-" STRINGIFY(MESH_NUM_Y_POINTS) ")."); | ||||||
|             return; |             return; | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|           SERIAL_PROTOCOLPGM("Y not entered.\n"); |           SERIAL_PROTOCOLLNPGM("Y not entered."); | ||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|         if (code_seen('Z')) { |         if (code_seen('Z')) { | ||||||
|           z = code_value_axis_units(Z_AXIS); |           z = code_value_axis_units(Z_AXIS); | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|           SERIAL_PROTOCOLPGM("Z not entered.\n"); |           SERIAL_PROTOCOLLNPGM("Z not entered."); | ||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|         mbl.z_values[py][px] = z; |         mbl.z_values[py][px] = z; | ||||||
| @ -3302,7 +3293,7 @@ inline void gcode_G28() { | |||||||
|           z = code_value_axis_units(Z_AXIS); |           z = code_value_axis_units(Z_AXIS); | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|           SERIAL_PROTOCOLPGM("Z not entered.\n"); |           SERIAL_PROTOCOLLNPGM("Z not entered."); | ||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|         mbl.z_offset = z; |         mbl.z_offset = z; | ||||||
| @ -3368,7 +3359,7 @@ inline void gcode_G28() { | |||||||
| 
 | 
 | ||||||
|     #if ENABLED(DEBUG_LEVELING_FEATURE) |     #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|       if (DEBUGGING(LEVELING)) { |       if (DEBUGGING(LEVELING)) { | ||||||
|         SERIAL_ECHOLNPGM("gcode_G29 >>>"); |         SERIAL_ECHOLNPGM(">>> gcode_G29"); | ||||||
|         DEBUG_POS("", current_position); |         DEBUG_POS("", current_position); | ||||||
|       } |       } | ||||||
|     #endif |     #endif | ||||||
| @ -3397,8 +3388,8 @@ inline void gcode_G28() { | |||||||
|       #endif |       #endif | ||||||
| 
 | 
 | ||||||
|       if (verbose_level > 0) { |       if (verbose_level > 0) { | ||||||
|         SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling\n"); |         SERIAL_PROTOCOLLNPGM("G29 Auto Bed Leveling"); | ||||||
|         if (dryrun) SERIAL_ECHOLNPGM("Running in DRY-RUN mode"); |         if (dryrun) SERIAL_PROTOCOLLNPGM("Running in DRY-RUN mode"); | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS; |       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS; | ||||||
| @ -3406,7 +3397,7 @@ inline void gcode_G28() { | |||||||
|       #if DISABLED(DELTA) |       #if DISABLED(DELTA) | ||||||
|         if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int(); |         if (code_seen('P')) auto_bed_leveling_grid_points = code_value_int(); | ||||||
|         if (auto_bed_leveling_grid_points < 2) { |         if (auto_bed_leveling_grid_points < 2) { | ||||||
|           SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n"); |           SERIAL_PROTOCOLLNPGM("?Number of probed (P)oints is implausible (2 minimum)."); | ||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|       #endif |       #endif | ||||||
| @ -3637,17 +3628,17 @@ inline void gcode_G28() { | |||||||
|         // Show the Topography map if enabled
 |         // Show the Topography map if enabled
 | ||||||
|         if (do_topography_map) { |         if (do_topography_map) { | ||||||
| 
 | 
 | ||||||
|           SERIAL_PROTOCOLPGM(" \nBed Height Topography: \n"); |           SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n" | ||||||
|           SERIAL_PROTOCOLPGM("   +--- BACK --+\n"); |                                  "   +--- BACK --+\n" | ||||||
|           SERIAL_PROTOCOLPGM("   |           |\n"); |                                  "   |           |\n" | ||||||
|           SERIAL_PROTOCOLPGM(" L |    (+)    | R\n"); |                                  " L |    (+)    | R\n" | ||||||
|           SERIAL_PROTOCOLPGM(" E |           | I\n"); |                                  " E |           | I\n" | ||||||
|           SERIAL_PROTOCOLPGM(" F | (-) N (+) | G\n"); |                                  " F | (-) N (+) | G\n" | ||||||
|           SERIAL_PROTOCOLPGM(" T |           | H\n"); |                                  " T |           | H\n" | ||||||
|           SERIAL_PROTOCOLPGM("   |    (-)    | T\n"); |                                  "   |    (-)    | T\n" | ||||||
|           SERIAL_PROTOCOLPGM("   |           |\n"); |                                  "   |           |\n" | ||||||
|           SERIAL_PROTOCOLPGM("   O-- FRONT --+\n"); |                                  "   O-- FRONT --+\n" | ||||||
|           SERIAL_PROTOCOLPGM(" (0,0)\n"); |                                  " (0,0)"); | ||||||
| 
 | 
 | ||||||
|           float min_diff = 999; |           float min_diff = 999; | ||||||
| 
 | 
 | ||||||
| @ -3674,7 +3665,7 @@ inline void gcode_G28() { | |||||||
|           } // yy
 |           } // yy
 | ||||||
|           SERIAL_EOL; |           SERIAL_EOL; | ||||||
|           if (verbose_level > 3) { |           if (verbose_level > 3) { | ||||||
|             SERIAL_PROTOCOLPGM(" \nCorrected Bed Height vs. Bed Topology: \n"); |             SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:"); | ||||||
| 
 | 
 | ||||||
|             for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) { |             for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) { | ||||||
|               for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) { |               for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) { | ||||||
| @ -3747,7 +3738,7 @@ inline void gcode_G28() { | |||||||
|     #ifdef Z_PROBE_END_SCRIPT |     #ifdef Z_PROBE_END_SCRIPT | ||||||
|       #if ENABLED(DEBUG_LEVELING_FEATURE) |       #if ENABLED(DEBUG_LEVELING_FEATURE) | ||||||
|         if (DEBUGGING(LEVELING)) { |         if (DEBUGGING(LEVELING)) { | ||||||
|           SERIAL_ECHO("Z Probe End Script: "); |           SERIAL_ECHOPGM("Z Probe End Script: "); | ||||||
|           SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT); |           SERIAL_ECHOLNPGM(Z_PROBE_END_SCRIPT); | ||||||
|         } |         } | ||||||
|       #endif |       #endif | ||||||
| @ -4130,16 +4121,16 @@ inline void gcode_M42() { | |||||||
| 
 | 
 | ||||||
|     int8_t verbose_level = code_seen('V') ? code_value_byte() : 1; |     int8_t verbose_level = code_seen('V') ? code_value_byte() : 1; | ||||||
|     if (verbose_level < 0 || verbose_level > 4) { |     if (verbose_level < 0 || verbose_level > 4) { | ||||||
|       SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n"); |       SERIAL_PROTOCOLLNPGM("?Verbose Level not plausible (0-4)."); | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (verbose_level > 0) |     if (verbose_level > 0) | ||||||
|       SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n"); |       SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability test"); | ||||||
| 
 | 
 | ||||||
|     int8_t n_samples = code_seen('P') ? code_value_byte() : 10; |     int8_t n_samples = code_seen('P') ? code_value_byte() : 10; | ||||||
|     if (n_samples < 4 || n_samples > 50) { |     if (n_samples < 4 || n_samples > 50) { | ||||||
|       SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n"); |       SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50)."); | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -4168,7 +4159,7 @@ inline void gcode_M42() { | |||||||
|       } |       } | ||||||
|     #else |     #else | ||||||
|       if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) { |       if (sqrt(X_probe_location * X_probe_location + Y_probe_location * Y_probe_location) > DELTA_PROBEABLE_RADIUS) { | ||||||
|         SERIAL_PROTOCOLPGM("? (X,Y) location outside of probeable radius.\n"); |         SERIAL_PROTOCOLLNPGM("? (X,Y) location outside of probeable radius."); | ||||||
|         return; |         return; | ||||||
|       } |       } | ||||||
|     #endif |     #endif | ||||||
| @ -4176,7 +4167,7 @@ inline void gcode_M42() { | |||||||
|     bool seen_L = code_seen('L'); |     bool seen_L = code_seen('L'); | ||||||
|     uint8_t n_legs = seen_L ? code_value_byte() : 0; |     uint8_t n_legs = seen_L ? code_value_byte() : 0; | ||||||
|     if (n_legs > 15) { |     if (n_legs > 15) { | ||||||
|       SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); |       SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15)."); | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     if (n_legs == 1) n_legs = 2; |     if (n_legs == 1) n_legs = 2; | ||||||
| @ -4190,7 +4181,7 @@ inline void gcode_M42() { | |||||||
|      * we don't want to use that as a starting point for each probe. |      * we don't want to use that as a starting point for each probe. | ||||||
|      */ |      */ | ||||||
|     if (verbose_level > 2) |     if (verbose_level > 2) | ||||||
|       SERIAL_PROTOCOLPGM("Positioning the probe...\n"); |       SERIAL_PROTOCOLLNPGM("Positioning the probe..."); | ||||||
| 
 | 
 | ||||||
|     #if ENABLED(DELTA) |     #if ENABLED(DELTA) | ||||||
|       // we don't do bed level correction in M48 because we want the raw data when we probe
 |       // we don't do bed level correction in M48 because we want the raw data when we probe
 | ||||||
| @ -4223,9 +4214,9 @@ inline void gcode_M42() { | |||||||
|         if (verbose_level > 3) { |         if (verbose_level > 3) { | ||||||
|           SERIAL_ECHOPAIR("Starting radius: ", radius); |           SERIAL_ECHOPAIR("Starting radius: ", radius); | ||||||
|           SERIAL_ECHOPAIR("   angle: ", angle); |           SERIAL_ECHOPAIR("   angle: ", angle); | ||||||
|           SERIAL_ECHO(" Direction: "); |           SERIAL_ECHOPGM(" Direction: "); | ||||||
|           if (dir > 0) SERIAL_ECHO("Counter "); |           if (dir > 0) SERIAL_ECHOPGM("Counter-"); | ||||||
|           SERIAL_ECHOLN("Clockwise"); |           SERIAL_ECHOLNPGM("Clockwise"); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         for (uint8_t l = 0; l < n_legs - 1; l++) { |         for (uint8_t l = 0; l < n_legs - 1; l++) { | ||||||
| @ -4268,10 +4259,10 @@ inline void gcode_M42() { | |||||||
|             } |             } | ||||||
|           #endif |           #endif | ||||||
|           if (verbose_level > 3) { |           if (verbose_level > 3) { | ||||||
|             SERIAL_PROTOCOL("Going to:"); |             SERIAL_PROTOCOLPGM("Going to:"); | ||||||
|             SERIAL_ECHOPAIR("x: ", X_current); |             SERIAL_ECHOPAIR(" X", X_current); | ||||||
|             SERIAL_ECHOPAIR("y: ", Y_current); |             SERIAL_ECHOPAIR(" Y", Y_current); | ||||||
|             SERIAL_ECHOPAIR("  z: ", current_position[Z_AXIS]); |             SERIAL_ECHOPAIR(" Z", current_position[Z_AXIS]); | ||||||
|             SERIAL_EOL; |             SERIAL_EOL; | ||||||
|           } |           } | ||||||
|           do_blocking_move_to_xy(X_current, Y_current); |           do_blocking_move_to_xy(X_current, Y_current); | ||||||
| @ -5542,9 +5533,9 @@ inline void gcode_M226() { | |||||||
|     } |     } | ||||||
|     else if (servo_index >= 0) { |     else if (servo_index >= 0) { | ||||||
|       SERIAL_ECHO_START; |       SERIAL_ECHO_START; | ||||||
|       SERIAL_ECHO(" Servo "); |       SERIAL_ECHOPGM(" Servo "); | ||||||
|       SERIAL_ECHO(servo_index); |       SERIAL_ECHO(servo_index); | ||||||
|       SERIAL_ECHO(": "); |       SERIAL_ECHOPGM(": "); | ||||||
|       SERIAL_ECHOLN(servo[servo_index].read()); |       SERIAL_ECHOLN(servo[servo_index].read()); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| @ -5601,17 +5592,17 @@ inline void gcode_M226() { | |||||||
|       thermalManager.updatePID(); |       thermalManager.updatePID(); | ||||||
|       SERIAL_ECHO_START; |       SERIAL_ECHO_START; | ||||||
|       #if ENABLED(PID_PARAMS_PER_HOTEND) |       #if ENABLED(PID_PARAMS_PER_HOTEND) | ||||||
|         SERIAL_ECHO(" e:"); // specify extruder in serial output
 |         SERIAL_ECHOPGM(" e:"); // specify extruder in serial output
 | ||||||
|         SERIAL_ECHO(e); |         SERIAL_ECHO(e); | ||||||
|       #endif // PID_PARAMS_PER_HOTEND
 |       #endif // PID_PARAMS_PER_HOTEND
 | ||||||
|       SERIAL_ECHO(" p:"); |       SERIAL_ECHOPGM(" p:"); | ||||||
|       SERIAL_ECHO(PID_PARAM(Kp, e)); |       SERIAL_ECHO(PID_PARAM(Kp, e)); | ||||||
|       SERIAL_ECHO(" i:"); |       SERIAL_ECHOPGM(" i:"); | ||||||
|       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e))); |       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e))); | ||||||
|       SERIAL_ECHO(" d:"); |       SERIAL_ECHOPGM(" d:"); | ||||||
|       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e))); |       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e))); | ||||||
|       #if ENABLED(PID_ADD_EXTRUSION_RATE) |       #if ENABLED(PID_ADD_EXTRUSION_RATE) | ||||||
|         SERIAL_ECHO(" c:"); |         SERIAL_ECHOPGM(" c:"); | ||||||
|         //Kc does not have scaling applied above, or in resetting defaults
 |         //Kc does not have scaling applied above, or in resetting defaults
 | ||||||
|         SERIAL_ECHO(PID_PARAM(Kc, e)); |         SERIAL_ECHO(PID_PARAM(Kc, e)); | ||||||
|       #endif |       #endif | ||||||
| @ -5635,11 +5626,11 @@ inline void gcode_M226() { | |||||||
|     thermalManager.updatePID(); |     thermalManager.updatePID(); | ||||||
| 
 | 
 | ||||||
|     SERIAL_ECHO_START; |     SERIAL_ECHO_START; | ||||||
|     SERIAL_ECHO(" p:"); |     SERIAL_ECHOPGM(" p:"); | ||||||
|     SERIAL_ECHO(thermalManager.bedKp); |     SERIAL_ECHO(thermalManager.bedKp); | ||||||
|     SERIAL_ECHO(" i:"); |     SERIAL_ECHOPGM(" i:"); | ||||||
|     SERIAL_ECHO(unscalePID_i(thermalManager.bedKi)); |     SERIAL_ECHO(unscalePID_i(thermalManager.bedKi)); | ||||||
|     SERIAL_ECHO(" d:"); |     SERIAL_ECHOPGM(" d:"); | ||||||
|     SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd)); |     SERIAL_ECHOLN(unscalePID_d(thermalManager.bedKd)); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -5739,7 +5730,7 @@ inline void gcode_M303() { | |||||||
| #if ENABLED(SCARA) | #if ENABLED(SCARA) | ||||||
|   bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) { |   bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) { | ||||||
|     //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
 |     //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
 | ||||||
|     //SERIAL_ECHOLN(" Soft endstops disabled ");
 |     //SERIAL_ECHOLNPGM(" Soft endstops disabled");
 | ||||||
|     if (IsRunning()) { |     if (IsRunning()) { | ||||||
|       //gcode_get_destination(); // For X Y Z E F
 |       //gcode_get_destination(); // For X Y Z E F
 | ||||||
|       delta[X_AXIS] = delta_x; |       delta[X_AXIS] = delta_x; | ||||||
| @ -5758,7 +5749,7 @@ inline void gcode_M303() { | |||||||
|    * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration) |    * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration) | ||||||
|    */ |    */ | ||||||
|   inline bool gcode_M360() { |   inline bool gcode_M360() { | ||||||
|     SERIAL_ECHOLN(" Cal: Theta 0 "); |     SERIAL_ECHOLNPGM(" Cal: Theta 0"); | ||||||
|     return SCARA_move_to_cal(0, 120); |     return SCARA_move_to_cal(0, 120); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -5766,7 +5757,7 @@ inline void gcode_M303() { | |||||||
|    * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) |    * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) | ||||||
|    */ |    */ | ||||||
|   inline bool gcode_M361() { |   inline bool gcode_M361() { | ||||||
|     SERIAL_ECHOLN(" Cal: Theta 90 "); |     SERIAL_ECHOLNPGM(" Cal: Theta 90"); | ||||||
|     return SCARA_move_to_cal(90, 130); |     return SCARA_move_to_cal(90, 130); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -5774,7 +5765,7 @@ inline void gcode_M303() { | |||||||
|    * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration) |    * M362: SCARA calibration: Move to cal-position PsiA (0 deg calibration) | ||||||
|    */ |    */ | ||||||
|   inline bool gcode_M362() { |   inline bool gcode_M362() { | ||||||
|     SERIAL_ECHOLN(" Cal: Psi 0 "); |     SERIAL_ECHOLNPGM(" Cal: Psi 0"); | ||||||
|     return SCARA_move_to_cal(60, 180); |     return SCARA_move_to_cal(60, 180); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -5782,7 +5773,7 @@ inline void gcode_M303() { | |||||||
|    * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) |    * M363: SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) | ||||||
|    */ |    */ | ||||||
|   inline bool gcode_M363() { |   inline bool gcode_M363() { | ||||||
|     SERIAL_ECHOLN(" Cal: Psi 90 "); |     SERIAL_ECHOLNPGM(" Cal: Psi 90"); | ||||||
|     return SCARA_move_to_cal(50, 90); |     return SCARA_move_to_cal(50, 90); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -5790,7 +5781,7 @@ inline void gcode_M303() { | |||||||
|    * M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) |    * M364: SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) | ||||||
|    */ |    */ | ||||||
|   inline bool gcode_M364() { |   inline bool gcode_M364() { | ||||||
|     SERIAL_ECHOLN(" Cal: Theta-Psi 90 "); |     SERIAL_ECHOLNPGM(" Cal: Theta-Psi 90"); | ||||||
|     return SCARA_move_to_cal(45, 135); |     return SCARA_move_to_cal(45, 135); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -6109,6 +6100,7 @@ inline void gcode_M503() { | |||||||
|       else { |       else { | ||||||
|         SERIAL_ECHOPGM(MSG_Z_MIN); |         SERIAL_ECHOPGM(MSG_Z_MIN); | ||||||
|         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN); |         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN); | ||||||
|  |         SERIAL_CHAR(' '); | ||||||
|         SERIAL_ECHOPGM(MSG_Z_MAX); |         SERIAL_ECHOPGM(MSG_Z_MAX); | ||||||
|         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX); |         SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX); | ||||||
|       } |       } | ||||||
| @ -6625,7 +6617,7 @@ inline void gcode_T(uint8_t tmp_extruder) { | |||||||
|   #endif |   #endif | ||||||
| 
 | 
 | ||||||
|   SERIAL_ECHO_START; |   SERIAL_ECHO_START; | ||||||
|   SERIAL_ECHO(MSG_ACTIVE_EXTRUDER); |   SERIAL_ECHOPGM(MSG_ACTIVE_EXTRUDER); | ||||||
|   SERIAL_PROTOCOLLN((int)active_extruder); |   SERIAL_PROTOCOLLN((int)active_extruder); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -102,7 +102,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m | |||||||
|       if (!dir.open(parent, lfilename, O_READ)) { |       if (!dir.open(parent, lfilename, O_READ)) { | ||||||
|         if (lsAction == LS_SerialPrint) { |         if (lsAction == LS_SerialPrint) { | ||||||
|           SERIAL_ECHO_START; |           SERIAL_ECHO_START; | ||||||
|           SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR); |           SERIAL_ECHOPGM(MSG_SD_CANT_OPEN_SUBDIR); | ||||||
|           SERIAL_ECHOLN(lfilename); |           SERIAL_ECHOLN(lfilename); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
| @ -357,8 +357,8 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { | |||||||
|     dirname_start = &name[1]; |     dirname_start = &name[1]; | ||||||
|     while (dirname_start != NULL) { |     while (dirname_start != NULL) { | ||||||
|       dirname_end = strchr(dirname_start, '/'); |       dirname_end = strchr(dirname_start, '/'); | ||||||
|       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
 |       //SERIAL_ECHOPGM("start:");SERIAL_ECHOLN((int)(dirname_start - name));
 | ||||||
|       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
 |       //SERIAL_ECHOPGM("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
 | ||||||
|       if (dirname_end != NULL && dirname_end > dirname_start) { |       if (dirname_end != NULL && dirname_end > dirname_start) { | ||||||
|         char subdirname[FILENAME_LENGTH]; |         char subdirname[FILENAME_LENGTH]; | ||||||
|         strncpy(subdirname, dirname_start, dirname_end - dirname_start); |         strncpy(subdirname, dirname_start, dirname_end - dirname_start); | ||||||
| @ -371,7 +371,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { | |||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|           //SERIAL_ECHOLN("dive ok");
 |           //SERIAL_ECHOLNPGM("dive ok");
 | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         curDir = &myDir; |         curDir = &myDir; | ||||||
| @ -379,7 +379,7 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { | |||||||
|       } |       } | ||||||
|       else { // the remainder after all /fsa/fdsa/ is the filename
 |       else { // the remainder after all /fsa/fdsa/ is the filename
 | ||||||
|         fname = dirname_start; |         fname = dirname_start; | ||||||
|         //SERIAL_ECHOLN("remainder");
 |         //SERIAL_ECHOLNPGM("remainder");
 | ||||||
|         //SERIAL_ECHOLN(fname);
 |         //SERIAL_ECHOLN(fname);
 | ||||||
|         break; |         break; | ||||||
|       } |       } | ||||||
| @ -392,10 +392,9 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { | |||||||
|   if (read) { |   if (read) { | ||||||
|     if (file.open(curDir, fname, O_READ)) { |     if (file.open(curDir, fname, O_READ)) { | ||||||
|       filesize = file.fileSize(); |       filesize = file.fileSize(); | ||||||
|       SERIAL_PROTOCOLPGM(MSG_SD_FILE_OPENED); |       SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname); | ||||||
|       SERIAL_PROTOCOL(fname); |       SERIAL_PROTOCOLPAIR(MSG_SD_SIZE, filesize); | ||||||
|       SERIAL_PROTOCOLPGM(MSG_SD_SIZE); |       SERIAL_EOL; | ||||||
|       SERIAL_PROTOCOLLN(filesize); |  | ||||||
|       sdpos = 0; |       sdpos = 0; | ||||||
| 
 | 
 | ||||||
|       SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED); |       SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED); | ||||||
| @ -403,21 +402,20 @@ void CardReader::openFile(char* name, bool read, bool push_current/*=false*/) { | |||||||
|       lcd_setstatus(longFilename[0] ? longFilename : fname); |       lcd_setstatus(longFilename[0] ? longFilename : fname); | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); |       SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); | ||||||
|       SERIAL_PROTOCOL(fname); |       SERIAL_PROTOCOLCHAR('.'); | ||||||
|       SERIAL_PROTOCOLPGM(".\n"); |       SERIAL_EOL; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   else { //write
 |   else { //write
 | ||||||
|     if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { |     if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { | ||||||
|       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); |       SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); | ||||||
|       SERIAL_PROTOCOL(fname); |       SERIAL_PROTOCOLCHAR('.'); | ||||||
|       SERIAL_PROTOCOLPGM(".\n"); |       SERIAL_EOL; | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|       saving = true; |       saving = true; | ||||||
|       SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE); |       SERIAL_PROTOCOLPAIR(MSG_SD_WRITE_TO_FILE, name); | ||||||
|       SERIAL_PROTOCOLLN(name); |  | ||||||
|       lcd_setstatus(fname); |       lcd_setstatus(fname); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| @ -438,21 +436,20 @@ void CardReader::removeFile(char* name) { | |||||||
|     dirname_start = strchr(name, '/') + 1; |     dirname_start = strchr(name, '/') + 1; | ||||||
|     while (dirname_start != NULL) { |     while (dirname_start != NULL) { | ||||||
|       dirname_end = strchr(dirname_start, '/'); |       dirname_end = strchr(dirname_start, '/'); | ||||||
|       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
 |       //SERIAL_ECHOPGM("start:");SERIAL_ECHOLN((int)(dirname_start - name));
 | ||||||
|       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
 |       //SERIAL_ECHOPGM("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
 | ||||||
|       if (dirname_end != NULL && dirname_end > dirname_start) { |       if (dirname_end != NULL && dirname_end > dirname_start) { | ||||||
|         char subdirname[FILENAME_LENGTH]; |         char subdirname[FILENAME_LENGTH]; | ||||||
|         strncpy(subdirname, dirname_start, dirname_end - dirname_start); |         strncpy(subdirname, dirname_start, dirname_end - dirname_start); | ||||||
|         subdirname[dirname_end - dirname_start] = 0; |         subdirname[dirname_end - dirname_start] = 0; | ||||||
|         SERIAL_ECHOLN(subdirname); |         SERIAL_ECHOLN(subdirname); | ||||||
|         if (!myDir.open(curDir, subdirname, O_READ)) { |         if (!myDir.open(curDir, subdirname, O_READ)) { | ||||||
|           SERIAL_PROTOCOLPGM("open failed, File: "); |           SERIAL_PROTOCOLPAIR("open failed, File: ", subdirname); | ||||||
|           SERIAL_PROTOCOL(subdirname); |  | ||||||
|           SERIAL_PROTOCOLCHAR('.'); |           SERIAL_PROTOCOLCHAR('.'); | ||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|           //SERIAL_ECHOLN("dive ok");
 |           //SERIAL_ECHOLNPGM("dive ok");
 | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         curDir = &myDir; |         curDir = &myDir; | ||||||
| @ -460,7 +457,7 @@ void CardReader::removeFile(char* name) { | |||||||
|       } |       } | ||||||
|       else { // the remainder after all /fsa/fdsa/ is the filename
 |       else { // the remainder after all /fsa/fdsa/ is the filename
 | ||||||
|         fname = dirname_start; |         fname = dirname_start; | ||||||
|         //SERIAL_ECHOLN("remainder");
 |         //SERIAL_ECHOLNPGM("remainder");
 | ||||||
|         //SERIAL_ECHOLN(fname);
 |         //SERIAL_ECHOLN(fname);
 | ||||||
|         break; |         break; | ||||||
|       } |       } | ||||||
|  | |||||||
| @ -344,7 +344,9 @@ void Config_RetrieveSettings() { | |||||||
|   char stored_ver[4]; |   char stored_ver[4]; | ||||||
|   char ver[4] = EEPROM_VERSION; |   char ver[4] = EEPROM_VERSION; | ||||||
|   EEPROM_READ_VAR(i, stored_ver); //read stored version
 |   EEPROM_READ_VAR(i, stored_ver); //read stored version
 | ||||||
|   //  SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
 |   //  SERIAL_ECHOPAIR("Version: [", ver);
 | ||||||
|  |   //  SERIAL_ECHOPAIR("] Stored version: [", stored_ver);
 | ||||||
|  |   //  SERIAL_ECHOLNPGM("]");
 | ||||||
| 
 | 
 | ||||||
|   if (strncmp(ver, stored_ver, 3) != 0) { |   if (strncmp(ver, stored_ver, 3) != 0) { | ||||||
|     Config_ResetDefault(); |     Config_ResetDefault(); | ||||||
| @ -717,7 +719,7 @@ void Config_PrintSettings(bool forReplay) { | |||||||
| 
 | 
 | ||||||
|   CONFIG_ECHO_START; |   CONFIG_ECHO_START; | ||||||
|   if (!forReplay) { |   if (!forReplay) { | ||||||
|     SERIAL_ECHOLNPGM("Home offset (mm):"); |     SERIAL_ECHOLNPGM("Home offset (mm)"); | ||||||
|     CONFIG_ECHO_START; |     CONFIG_ECHO_START; | ||||||
|   } |   } | ||||||
|   SERIAL_ECHOPAIR("  M206 X", home_offset[X_AXIS]); |   SERIAL_ECHOPAIR("  M206 X", home_offset[X_AXIS]); | ||||||
| @ -883,7 +885,7 @@ void Config_PrintSettings(bool forReplay) { | |||||||
|       SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries"); |       SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries"); | ||||||
|       CONFIG_ECHO_START; |       CONFIG_ECHO_START; | ||||||
|     } |     } | ||||||
|     SERIAL_ECHOPAIR("  M209 S", (autoretract_enabled ? 1 : 0)); |     SERIAL_ECHOPAIR("  M209 S", autoretract_enabled ? 1 : 0); | ||||||
|     SERIAL_EOL; |     SERIAL_EOL; | ||||||
| 
 | 
 | ||||||
|   #endif // FWRETRACT
 |   #endif // FWRETRACT
 | ||||||
|  | |||||||
| @ -197,7 +197,7 @@ void Endstops::report_state() { | |||||||
| } // Endstops::report_state
 | } // Endstops::report_state
 | ||||||
| 
 | 
 | ||||||
| void Endstops::M119() { | void Endstops::M119() { | ||||||
|   SERIAL_PROTOCOLLN(MSG_M119_REPORT); |   SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT); | ||||||
|   #if HAS_X_MIN |   #if HAS_X_MIN | ||||||
|     SERIAL_PROTOCOLPGM(MSG_X_MIN); |     SERIAL_PROTOCOLPGM(MSG_X_MIN); | ||||||
|     SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); |     SERIAL_PROTOCOLLN(((READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) ? MSG_ENDSTOP_HIT : MSG_ENDSTOP_OPEN)); | ||||||
|  | |||||||
| @ -1103,7 +1103,7 @@ void Stepper::microstep_mode(uint8_t driver, uint8_t stepping_mode) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Stepper::microstep_readings() { | void Stepper::microstep_readings() { | ||||||
|   SERIAL_PROTOCOLPGM("MS1,MS2 Pins\n"); |   SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); | ||||||
|   SERIAL_PROTOCOLPGM("X: "); |   SERIAL_PROTOCOLPGM("X: "); | ||||||
|   SERIAL_PROTOCOL(digitalRead(X_MS1_PIN)); |   SERIAL_PROTOCOL(digitalRead(X_MS1_PIN)); | ||||||
|   SERIAL_PROTOCOLLN(digitalRead(X_MS2_PIN)); |   SERIAL_PROTOCOLLN(digitalRead(X_MS2_PIN)); | ||||||
|  | |||||||
| @ -103,7 +103,7 @@ | |||||||
|     SERIAL_ECHOPAIR(" (",   dac_amps(2)); |     SERIAL_ECHOPAIR(" (",   dac_amps(2)); | ||||||
|     SERIAL_ECHOPAIR(") E:", dac_perc(3)); |     SERIAL_ECHOPAIR(") E:", dac_perc(3)); | ||||||
|     SERIAL_ECHOPAIR(" (",   dac_amps(3)); |     SERIAL_ECHOPAIR(" (",   dac_amps(3)); | ||||||
|     SERIAL_ECHOLN(")"); |     SERIAL_ECHOLNPGM(")"); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void dac_commit_eeprom() { |   void dac_commit_eeprom() { | ||||||
|  | |||||||
| @ -304,37 +304,37 @@ unsigned char Temperature::soft_pwm[HOTENDS]; | |||||||
|               bias = constrain(bias, 20, max_pow - 20); |               bias = constrain(bias, 20, max_pow - 20); | ||||||
|               d = (bias > max_pow / 2) ? max_pow - 1 - bias : bias; |               d = (bias > max_pow / 2) ? max_pow - 1 - bias : bias; | ||||||
| 
 | 
 | ||||||
|               SERIAL_PROTOCOLPGM(MSG_BIAS); SERIAL_PROTOCOL(bias); |               SERIAL_PROTOCOLPAIR(MSG_BIAS, bias); | ||||||
|               SERIAL_PROTOCOLPGM(MSG_D);    SERIAL_PROTOCOL(d); |               SERIAL_PROTOCOLPAIR(MSG_D, d); | ||||||
|               SERIAL_PROTOCOLPGM(MSG_T_MIN);  SERIAL_PROTOCOL(min); |               SERIAL_PROTOCOLPAIR(MSG_T_MIN, min); | ||||||
|               SERIAL_PROTOCOLPGM(MSG_T_MAX);  SERIAL_PROTOCOLLN(max); |               SERIAL_PROTOCOLPAIR(MSG_T_MAX, max); | ||||||
|               if (cycles > 2) { |               if (cycles > 2) { | ||||||
|                 Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0); |                 Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0); | ||||||
|                 Tu = ((float)(t_low + t_high) / 1000.0); |                 Tu = ((float)(t_low + t_high) / 1000.0); | ||||||
|                 SERIAL_PROTOCOLPGM(MSG_KU); SERIAL_PROTOCOL(Ku); |                 SERIAL_PROTOCOLPAIR(MSG_KU, Ku); | ||||||
|                 SERIAL_PROTOCOLPGM(MSG_TU); SERIAL_PROTOCOLLN(Tu); |                 SERIAL_PROTOCOLPAIR(MSG_TU, Tu); | ||||||
|                 workKp = 0.6 * Ku; |                 workKp = 0.6 * Ku; | ||||||
|                 workKi = 2 * workKp / Tu; |                 workKi = 2 * workKp / Tu; | ||||||
|                 workKd = workKp * Tu / 8; |                 workKd = workKp * Tu / 8; | ||||||
|                 SERIAL_PROTOCOLLNPGM(MSG_CLASSIC_PID); |                 SERIAL_PROTOCOLLNPGM(MSG_CLASSIC_PID); | ||||||
|                 SERIAL_PROTOCOLPGM(MSG_KP); SERIAL_PROTOCOLLN(workKp); |                 SERIAL_PROTOCOLPAIR(MSG_KP, workKp); | ||||||
|                 SERIAL_PROTOCOLPGM(MSG_KI); SERIAL_PROTOCOLLN(workKi); |                 SERIAL_PROTOCOLPAIR(MSG_KI, workKi); | ||||||
|                 SERIAL_PROTOCOLPGM(MSG_KD); SERIAL_PROTOCOLLN(workKd); |                 SERIAL_PROTOCOLPAIR(MSG_KD, workKd); | ||||||
|                 /**
 |                 /**
 | ||||||
|                 workKp = 0.33*Ku; |                 workKp = 0.33*Ku; | ||||||
|                 workKi = workKp/Tu; |                 workKi = workKp/Tu; | ||||||
|                 workKd = workKp*Tu/3; |                 workKd = workKp*Tu/3; | ||||||
|                 SERIAL_PROTOCOLLNPGM(" Some overshoot"); |                 SERIAL_PROTOCOLLNPGM(" Some overshoot"); | ||||||
|                 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(workKp); |                 SERIAL_PROTOCOLPAIR(" Kp: ", workKp); | ||||||
|                 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(workKi); |                 SERIAL_PROTOCOLPAIR(" Ki: ", workKi); | ||||||
|                 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(workKd); |                 SERIAL_PROTOCOLPAIR(" Kd: ", workKd); | ||||||
|                 workKp = 0.2*Ku; |                 workKp = 0.2*Ku; | ||||||
|                 workKi = 2*workKp/Tu; |                 workKi = 2*workKp/Tu; | ||||||
|                 workKd = workKp*Tu/3; |                 workKd = workKp*Tu/3; | ||||||
|                 SERIAL_PROTOCOLLNPGM(" No overshoot"); |                 SERIAL_PROTOCOLLNPGM(" No overshoot"); | ||||||
|                 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(workKp); |                 SERIAL_PROTOCOLPAIR(" Kp: ", workKp); | ||||||
|                 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(workKi); |                 SERIAL_PROTOCOLPAIR(" Ki: ", workKi); | ||||||
|                 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(workKd); |                 SERIAL_PROTOCOLPAIR(" Kd: ", workKd); | ||||||
|                 */ |                 */ | ||||||
|               } |               } | ||||||
|             } |             } | ||||||
| @ -377,17 +377,17 @@ unsigned char Temperature::soft_pwm[HOTENDS]; | |||||||
| 
 | 
 | ||||||
|         #if HAS_PID_FOR_BOTH |         #if HAS_PID_FOR_BOTH | ||||||
|           const char* estring = hotend < 0 ? "bed" : ""; |           const char* estring = hotend < 0 ? "bed" : ""; | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kp "); SERIAL_PROTOCOLLN(workKp); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kp ", workKp); | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Ki "); SERIAL_PROTOCOLLN(workKi); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Ki ", workKi); | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_"); SERIAL_PROTOCOL(estring); SERIAL_PROTOCOLPGM("Kd "); SERIAL_PROTOCOLLN(workKd); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_", estring); SERIAL_PROTOCOLPAIR("Kd ", workKd); | ||||||
|         #elif ENABLED(PIDTEMP) |         #elif ENABLED(PIDTEMP) | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_Kp "); SERIAL_PROTOCOLLN(workKp); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_Kp ", workKp); | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_Ki "); SERIAL_PROTOCOLLN(workKi); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_Ki ", workKi); | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_Kd "); SERIAL_PROTOCOLLN(workKd); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_Kd ", workKd); | ||||||
|         #else |         #else | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_bedKp "); SERIAL_PROTOCOLLN(workKp); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_bedKp ", workKp); | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_bedKi "); SERIAL_PROTOCOLLN(workKi); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_bedKi ", workKi); | ||||||
|           SERIAL_PROTOCOLPGM("#define  DEFAULT_bedKd "); SERIAL_PROTOCOLLN(workKd); |           SERIAL_PROTOCOLPAIR("#define  DEFAULT_bedKd ", workKd); | ||||||
|         #endif |         #endif | ||||||
| 
 | 
 | ||||||
|         #define _SET_BED_PID() \ |         #define _SET_BED_PID() \ | ||||||
| @ -626,16 +626,16 @@ float Temperature::get_pid_output(int e) { | |||||||
| 
 | 
 | ||||||
|     #if ENABLED(PID_BED_DEBUG) |     #if ENABLED(PID_BED_DEBUG) | ||||||
|       SERIAL_ECHO_START; |       SERIAL_ECHO_START; | ||||||
|       SERIAL_ECHO(" PID_BED_DEBUG "); |       SERIAL_ECHOPGM(" PID_BED_DEBUG "); | ||||||
|       SERIAL_ECHO(": Input "); |       SERIAL_ECHOPGM(": Input "); | ||||||
|       SERIAL_ECHO(current_temperature_bed); |       SERIAL_ECHO(current_temperature_bed); | ||||||
|       SERIAL_ECHO(" Output "); |       SERIAL_ECHOPGM(" Output "); | ||||||
|       SERIAL_ECHO(pid_output); |       SERIAL_ECHO(pid_output); | ||||||
|       SERIAL_ECHO(" pTerm "); |       SERIAL_ECHOPGM(" pTerm "); | ||||||
|       SERIAL_ECHO(pTerm_bed); |       SERIAL_ECHO(pTerm_bed); | ||||||
|       SERIAL_ECHO(" iTerm "); |       SERIAL_ECHOPGM(" iTerm "); | ||||||
|       SERIAL_ECHO(iTerm_bed); |       SERIAL_ECHO(iTerm_bed); | ||||||
|       SERIAL_ECHO(" dTerm "); |       SERIAL_ECHOPGM(" dTerm "); | ||||||
|       SERIAL_ECHOLN(dTerm_bed); |       SERIAL_ECHOLN(dTerm_bed); | ||||||
|     #endif //PID_BED_DEBUG
 |     #endif //PID_BED_DEBUG
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -2266,14 +2266,11 @@ void lcd_update() { | |||||||
| 
 | 
 | ||||||
|                 #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) |                 #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) | ||||||
|                   SERIAL_ECHO_START; |                   SERIAL_ECHO_START; | ||||||
|                   SERIAL_ECHO("Enc Step Rate: "); |                   SERIAL_ECHOPAIR("Enc Step Rate: ", encoderStepRate); | ||||||
|                   SERIAL_ECHO(encoderStepRate); |                   SERIAL_ECHOPAIR("  Multiplier: ", encoderMultiplier); | ||||||
|                   SERIAL_ECHO("  Multiplier: "); |                   SERIAL_ECHOPAIR("  ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC); | ||||||
|                   SERIAL_ECHO(encoderMultiplier); |                   SERIAL_ECHOPAIR("  ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC); | ||||||
|                   SERIAL_ECHO("  ENCODER_10X_STEPS_PER_SEC: "); |                   SERIAL_EOL; | ||||||
|                   SERIAL_ECHO(ENCODER_10X_STEPS_PER_SEC); |  | ||||||
|                   SERIAL_ECHO("  ENCODER_100X_STEPS_PER_SEC: "); |  | ||||||
|                   SERIAL_ECHOLN(ENCODER_100X_STEPS_PER_SEC); |  | ||||||
|                 #endif //ENCODER_RATE_MULTIPLIER_DEBUG
 |                 #endif //ENCODER_RATE_MULTIPLIER_DEBUG
 | ||||||
|               } |               } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user