From e0d4368cb50730f130851729a18b4ac4b64fe7d9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 20:45:24 -0700 Subject: [PATCH 1/4] Minor code cleanup, move NUM_AXIS out of config --- Marlin/Configuration.h | 6 ++- Marlin/Marlin.h | 45 ++++++++++++------- Marlin/configurator/config/Configuration.h | 6 ++- .../Felix/Configuration.h | 6 ++- .../Felix/Configuration_DUAL.h | 6 ++- .../Hephestos/Configuration.h | 6 ++- .../K8200/Configuration.h | 6 ++- .../SCARA/Configuration.h | 6 ++- .../WITBOX/Configuration.h | 6 ++- .../delta/generic/Configuration.h | 6 ++- .../delta/kossel_mini/Configuration.h | 6 ++- .../makibox/Configuration.h | 6 ++- .../tvrrug/Round2/Configuration.h | 6 ++- Marlin/planner.cpp | 6 +-- 14 files changed, 80 insertions(+), 43 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 321c25f97c..5d9586808a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -529,8 +529,10 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 1f295a65a5..6a0f21f3b8 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -93,18 +93,15 @@ void serial_echopair_P(const char *s_P, double v); void serial_echopair_P(const char *s_P, unsigned long v); -//Things to write to serial from Program memory. Saves 400 to 2k of RAM. -FORCE_INLINE void serialprintPGM(const char *str) -{ - char ch=pgm_read_byte(str); - while(ch) - { +// Things to write to serial from Program memory. Saves 400 to 2k of RAM. +FORCE_INLINE void serialprintPGM(const char *str) { + char ch = pgm_read_byte(str); + while(ch) { MYSERIAL.write(ch); - ch=pgm_read_byte(++str); + ch = pgm_read_byte(++str); } } - void get_command(); void process_commands(); @@ -148,7 +145,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #if HAS_E0_ENABLE - #define enable_e0() E0_ENABLE_WRITE(E_ENABLE_ON) + #define enable_e0() E0_ENABLE_WRITE( E_ENABLE_ON) #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON) #else #define enable_e0() /* nothing */ @@ -156,7 +153,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #if (EXTRUDERS > 1) && HAS_E1_ENABLE - #define enable_e1() E1_ENABLE_WRITE(E_ENABLE_ON) + #define enable_e1() E1_ENABLE_WRITE( E_ENABLE_ON) #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON) #else #define enable_e1() /* nothing */ @@ -164,7 +161,7 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #if (EXTRUDERS > 2) && HAS_E2_ENABLE - #define enable_e2() E2_ENABLE_WRITE(E_ENABLE_ON) + #define enable_e2() E2_ENABLE_WRITE( E_ENABLE_ON) #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON) #else #define enable_e2() /* nothing */ @@ -172,15 +169,25 @@ void manage_inactivity(bool ignore_stepper_queue=false); #endif #if (EXTRUDERS > 3) && HAS_E3_ENABLE - #define enable_e3() E3_ENABLE_WRITE(E_ENABLE_ON) + #define enable_e3() E3_ENABLE_WRITE( E_ENABLE_ON) #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON) #else #define enable_e3() /* nothing */ #define disable_e3() /* nothing */ #endif +/** + * The axis order in all axis related arrays is X, Y, Z, E + */ +#define NUM_AXIS 4 + +/** + * Axis indices as enumerated constants + * + * A_AXIS and B_AXIS are used by COREXY printers + * X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots. + */ enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5}; -//X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots. void FlushSerialRequestResend(); void ClearToSend(); @@ -224,7 +231,7 @@ void refresh_cmd_timeout(void); #ifndef CRITICAL_SECTION_START #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli(); #define CRITICAL_SECTION_END SREG = _sreg; -#endif //CRITICAL_SECTION_START +#endif extern float homing_feedrate[]; extern bool axis_relative_modes[]; @@ -233,8 +240,9 @@ extern bool volumetric_enabled; extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder. extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner -extern float current_position[NUM_AXIS] ; +extern float current_position[NUM_AXIS]; extern float home_offset[3]; + #ifdef DELTA extern float endstop_adj[3]; extern float delta_radius; @@ -242,18 +250,23 @@ extern float home_offset[3]; extern float delta_segments_per_second; void recalc_delta_settings(float radius, float diagonal_rod); #elif defined(Z_DUAL_ENDSTOPS) -extern float z_endstop_adj; + extern float z_endstop_adj; #endif + #ifdef SCARA extern float axis_scaling[3]; // Build size scaling #endif + extern float min_pos[3]; extern float max_pos[3]; extern bool axis_known_position[3]; + #ifdef ENABLE_AUTO_BED_LEVELING extern float zprobe_zoffset; #endif + extern int fanSpeed; + #ifdef BARICUDA extern int ValvePressure; extern int EtoPPressure; diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 3d9f634244..ca0b2d0791 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -553,8 +553,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o // @section movement -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 7f0b03049e..dfd79a0d97 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -499,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index fbb1445148..98dea404bf 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -499,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 3665760210..7eceefb986 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -522,8 +522,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {2000, 2000, 150, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 7ddf21e2b2..3a6aea9b1d 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -527,8 +527,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index a00a7b6e93..2616f155fd 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -551,8 +551,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define MANUAL_Z_HOME_POS 0.1 // Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 902985f31a..d7d32d0881 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -521,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {120*60, 120*60, 7.2*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 699b8a3b41..ac13788b22 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -566,8 +566,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + // delta homing speeds must be the same on xyz #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0} // set the homing speeds (mm/min) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 2e4ebb386c..38f5023552 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -570,8 +570,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + // delta homing speeds must be the same on xyz #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0} // set the homing speeds (mm/min) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 5c8e1d87db..24c3e5b4d8 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -519,8 +519,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {1500, 1500, 120, 0} // set the homing speeds (mm/min) ***** MakiBox A6 ***** // default settings diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 12bab57e37..649046b880 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -521,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing. #endif -//// MOVEMENT SETTINGS -#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E +/** + * MOVEMENT SETTINGS + */ + #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min) // default settings diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index d7d33c170e..8d8d2e3c4e 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -614,7 +614,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 1 case 1: enable_e1(); - g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[1] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); #if EXTRUDERS > 2 if (g_uc_extruder_last_move[2] == 0) disable_e2(); @@ -626,7 +626,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 2 case 2: enable_e2(); - g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[2] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); #if EXTRUDERS > 3 @@ -636,7 +636,7 @@ float junction_deviation = 0.1; #if EXTRUDERS > 3 case 3: enable_e3(); - g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE*2; + g_uc_extruder_last_move[3] = BLOCK_BUFFER_SIZE * 2; if (g_uc_extruder_last_move[0] == 0) disable_e0(); if (g_uc_extruder_last_move[1] == 0) disable_e1(); if (g_uc_extruder_last_move[2] == 0) disable_e2(); From 1e5c18bb148f84f2bcb2f38bf0ce53b62148bdb3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 21:43:30 -0700 Subject: [PATCH 2/4] Add code_value_short and SERIAL_CHAR --- Marlin/Marlin.h | 22 ++--- Marlin/MarlinSerial.cpp | 3 +- Marlin/Marlin_main.cpp | 195 +++++++++++++++++++++------------------- Marlin/cardreader.cpp | 12 +-- Marlin/vector_3.cpp | 4 +- 5 files changed, 122 insertions(+), 114 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 6a0f21f3b8..1ea5ba57f2 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -62,31 +62,33 @@ #define MYSERIAL MSerial #endif -#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x)) -#define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y)) -#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x))) -#define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n')) -#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n')) +#define SERIAL_CHAR(x) MYSERIAL.write(x) +#define SERIAL_EOL SERIAL_CHAR('\n') + +#define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x) +#define SERIAL_PROTOCOL(x) MYSERIAL.print(x) +#define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y) +#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x)) +#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x),MYSERIAL.write('\n'); }while(0) +#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)),MYSERIAL.write('\n'); }while(0) extern const char errormagic[] PROGMEM; extern const char echomagic[] PROGMEM; -#define SERIAL_ERROR_START (serialprintPGM(errormagic)) +#define SERIAL_ERROR_START serialprintPGM(errormagic) #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x) #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x) #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x) -#define SERIAL_ECHO_START (serialprintPGM(echomagic)) +#define SERIAL_ECHO_START serialprintPGM(echomagic) #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x) #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x) #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x) #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x) -#define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value))) - -#define SERIAL_EOL MYSERIAL.write('\n') +#define SERIAL_ECHOPAIR(name,value) do{ serial_echopair_P(PSTR(name),(value)); }while(0) void serial_echopair_P(const char *s_P, float v); void serial_echopair_P(const char *s_P, double v); diff --git a/Marlin/MarlinSerial.cpp b/Marlin/MarlinSerial.cpp index d8477b6db1..fcba93256b 100644 --- a/Marlin/MarlinSerial.cpp +++ b/Marlin/MarlinSerial.cpp @@ -268,8 +268,7 @@ void MarlinSerial::printFloat(double number, uint8_t digits) { print(int_part); // Print the decimal point, but only if there are digits beyond - if (digits > 0) - print("."); + if (digits > 0) print('.'); // Extract digits from the remainder one at a time while (digits-- > 0) { diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f160f07a4d..566f6c65fa 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -242,7 +242,7 @@ static unsigned long max_inactive_time = 0; static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l; unsigned long starttime = 0; ///< Print job start time unsigned long stoptime = 0; ///< Print job stop time -static uint8_t tmp_extruder; +static uint8_t target_extruder; bool Stopped = false; bool CooldownNoWait = true; bool target_direction; @@ -856,7 +856,9 @@ float code_value() { return ret; } -long code_value_long() { return (strtol(strchr_pointer + 1, NULL, 10)); } +long code_value_long() { return strtol(strchr_pointer + 1, NULL, 10); } + +int16_t code_value_short() { return (int16_t)strtol(strchr_pointer + 1, NULL, 10); } bool code_seen(char code) { strchr_pointer = strchr(cmdbuffer[bufindr], code); @@ -1409,9 +1411,9 @@ inline void sync_plan_position() { for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) { for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) { SERIAL_PROTOCOL_F(bed_level[x][y], 2); - SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOLCHAR(' '); } - SERIAL_ECHOLN(""); + SERIAL_EOL; } } @@ -1684,7 +1686,7 @@ inline void gcode_G2_G3(bool clockwise) { * G4: Dwell S or P */ inline void gcode_G4() { - unsigned long codenum=0; + unsigned long codenum = 0; LCD_MESSAGEPGM(MSG_DWELL); @@ -1710,7 +1712,7 @@ inline void gcode_G4() { inline void gcode_G10_G11(bool doRetract=false) { #if EXTRUDERS > 1 if (doRetract) { - retracted_swap[active_extruder] = (code_seen('S') && code_value_long() == 1); // checks for swap retract argument + retracted_swap[active_extruder] = (code_seen('S') && code_value_short() == 1); // checks for swap retract argument } #endif retract(doRetract @@ -2028,7 +2030,7 @@ inline void gcode_G28() { inline void gcode_G29() { static int probe_point = -1; - MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_long() : MeshReport; + MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_short() : MeshReport; if (state < 0 || state > 2) { SERIAL_PROTOCOLLNPGM("S out of range (0-2)."); return; @@ -2039,7 +2041,7 @@ inline void gcode_G28() { if (mbl.active) { SERIAL_PROTOCOLPGM("Num X,Y: "); SERIAL_PROTOCOL(MESH_NUM_X_POINTS); - SERIAL_PROTOCOLPGM(","); + SERIAL_PROTOCOLCHAR(','); SERIAL_PROTOCOL(MESH_NUM_Y_POINTS); SERIAL_PROTOCOLPGM("\nZ search height: "); SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z); @@ -2155,7 +2157,7 @@ inline void gcode_G28() { return; } - int verbose_level = code_seen('V') || code_seen('v') ? code_value_long() : 1; + int verbose_level = code_seen('V') || code_seen('v') ? code_value_short() : 1; if (verbose_level < 0 || verbose_level > 4) { SERIAL_ECHOLNPGM("?(V)erbose Level is implausible (0-4)."); return; @@ -2177,19 +2179,19 @@ inline void gcode_G28() { int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS; #ifndef DELTA - if (code_seen('P')) auto_bed_leveling_grid_points = code_value_long(); + if (code_seen('P')) auto_bed_leveling_grid_points = code_value_short(); if (auto_bed_leveling_grid_points < 2) { SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n"); return; } #endif - xy_travel_speed = code_seen('S') ? code_value_long() : XY_TRAVEL_SPEED; + xy_travel_speed = code_seen('S') ? code_value_short() : XY_TRAVEL_SPEED; - int left_probe_bed_position = code_seen('L') ? code_value_long() : LEFT_PROBE_BED_POSITION, - right_probe_bed_position = code_seen('R') ? code_value_long() : RIGHT_PROBE_BED_POSITION, - front_probe_bed_position = code_seen('F') ? code_value_long() : FRONT_PROBE_BED_POSITION, - back_probe_bed_position = code_seen('B') ? code_value_long() : BACK_PROBE_BED_POSITION; + int left_probe_bed_position = code_seen('L') ? code_value_short() : LEFT_PROBE_BED_POSITION, + right_probe_bed_position = code_seen('R') ? code_value_short() : RIGHT_PROBE_BED_POSITION, + front_probe_bed_position = code_seen('F') ? code_value_short() : FRONT_PROBE_BED_POSITION, + back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION; bool left_out_l = left_probe_bed_position < MIN_PROBE_X, left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - MIN_PROBE_EDGE, @@ -2393,7 +2395,7 @@ inline void gcode_G28() { if (diff >= 0.0) SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment else - SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOLCHAR(' '); SERIAL_PROTOCOL_F(diff, 5); } // xx SERIAL_EOL; @@ -2517,11 +2519,11 @@ inline void gcode_G92() { unsigned long codenum = 0; bool hasP = false, hasS = false; if (code_seen('P')) { - codenum = code_value(); // milliseconds to wait + codenum = code_value_short(); // milliseconds to wait hasP = codenum > 0; } if (code_seen('S')) { - codenum = code_value() * 1000; // seconds to wait + codenum = code_value_short() * 1000UL; // seconds to wait hasS = codenum > 0; } char* starpos = strchr(src, '*'); @@ -2633,7 +2635,7 @@ inline void gcode_M17() { */ inline void gcode_M26() { if (card.cardOK && code_seen('S')) - card.setIndex(code_value_long()); + card.setIndex(code_value_short()); } /** @@ -2724,7 +2726,7 @@ inline void gcode_M31() { card.openFile(namestartpos, true, !call_procedure); if (code_seen('S') && strchr_pointer < namestartpos) // "S" (must occur _before_ the filename!) - card.setIndex(code_value_long()); + card.setIndex(code_value_short()); card.startFileprint(); if (!call_procedure) @@ -2752,11 +2754,11 @@ inline void gcode_M31() { */ inline void gcode_M42() { if (code_seen('S')) { - int pin_status = code_value(), + int pin_status = code_value_short(), pin_number = LED_PIN; if (code_seen('P') && pin_status >= 0 && pin_status <= 255) - pin_number = code_value(); + pin_number = code_value_short(); for (int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins) / sizeof(*sensitive_pins)); i++) { if (sensitive_pins[i] == pin_number) { @@ -2815,7 +2817,7 @@ inline void gcode_M42() { int verbose_level = 1, n_samples = 10, n_legs = 0; if (code_seen('V') || code_seen('v')) { - verbose_level = code_value(); + verbose_level = code_value_short(); if (verbose_level < 0 || verbose_level > 4 ) { SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n"); return; @@ -2826,7 +2828,7 @@ inline void gcode_M42() { SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n"); if (code_seen('P') || code_seen('p') || code_seen('n')) { // `n` for legacy support only - please use `P`! - n_samples = code_value(); + n_samples = code_value_short(); if (n_samples < 4 || n_samples > 50) { SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n"); return; @@ -2859,7 +2861,7 @@ inline void gcode_M42() { } if (code_seen('L') || code_seen('l')) { - n_legs = code_value(); + n_legs = code_value_short(); if (n_legs == 1) n_legs = 2; if (n_legs < 0 || n_legs > 15) { SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n"); @@ -3041,12 +3043,15 @@ inline void gcode_M42() { inline void gcode_M104() { if (setTargetedHotend(104)) return; - if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder); - #ifdef DUAL_X_CARRIAGE - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0) - setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset); - #endif - setWatch(); + if (code_seen('S')) { + float temp = code_value(); + setTargetHotend(temp, target_extruder); + #ifdef DUAL_X_CARRIAGE + if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) + setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset); + #endif + setWatch(); + } } /** @@ -3057,9 +3062,9 @@ inline void gcode_M105() { #if HAS_TEMP_0 SERIAL_PROTOCOLPGM("ok T:"); - SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1); + SERIAL_PROTOCOL_F(degHotend(target_extruder),1); SERIAL_PROTOCOLPGM(" /"); - SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder),1); + SERIAL_PROTOCOL_F(degTargetHotend(target_extruder),1); #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B:"); SERIAL_PROTOCOL_F(degBed(),1); @@ -3069,7 +3074,7 @@ inline void gcode_M105() { for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { SERIAL_PROTOCOLPGM(" T"); SERIAL_PROTOCOL(cur_extruder); - SERIAL_PROTOCOLPGM(":"); + SERIAL_PROTOCOLCHAR(':'); SERIAL_PROTOCOL_F(degHotend(cur_extruder),1); SERIAL_PROTOCOLPGM(" /"); SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1); @@ -3081,16 +3086,16 @@ inline void gcode_M105() { SERIAL_PROTOCOLPGM(" @:"); #ifdef EXTRUDER_WATTS - SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(tmp_extruder))/127); - SERIAL_PROTOCOLPGM("W"); + SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder))/127); + SERIAL_PROTOCOLCHAR('W'); #else - SERIAL_PROTOCOL(getHeaterPower(tmp_extruder)); + SERIAL_PROTOCOL(getHeaterPower(target_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); #ifdef BED_WATTS SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1))/127); - SERIAL_PROTOCOLPGM("W"); + SERIAL_PROTOCOLCHAR('W'); #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif @@ -3105,7 +3110,7 @@ inline void gcode_M105() { for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) { SERIAL_PROTOCOLPGM(" T"); SERIAL_PROTOCOL(cur_extruder); - SERIAL_PROTOCOLPGM(":"); + SERIAL_PROTOCOLCHAR(':'); SERIAL_PROTOCOL_F(degHotend(cur_extruder),1); SERIAL_PROTOCOLPGM("C->"); SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0); @@ -3120,7 +3125,7 @@ inline void gcode_M105() { /** * M106: Set Fan Speed */ - inline void gcode_M106() { fanSpeed = code_seen('S') ? constrain(code_value(), 0, 255) : 255; } + inline void gcode_M106() { fanSpeed = code_seen('S') ? constrain(code_value_short(), 0, 255) : 255; } /** * M107: Fan Off @@ -3139,10 +3144,11 @@ inline void gcode_M109() { CooldownNoWait = code_seen('S'); if (CooldownNoWait || code_seen('R')) { - setTargetHotend(code_value(), tmp_extruder); + float temp = code_value(); + setTargetHotend(temp, target_extruder); #ifdef DUAL_X_CARRIAGE - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0) - setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset); + if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0) + setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset); #endif } @@ -3158,7 +3164,7 @@ inline void gcode_M109() { unsigned long timetemp = millis(); /* See if we are heating up or cooling down */ - target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling + target_direction = isHeatingHotend(target_extruder); // true if heating, false if cooling cancel_heatup = false; @@ -3169,15 +3175,15 @@ inline void gcode_M109() { while((!cancel_heatup)&&((residencyStart == -1) || (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) ) #else - while ( target_direction ? (isHeatingHotend(tmp_extruder)) : (isCoolingHotend(tmp_extruder)&&(CooldownNoWait==false)) ) + while ( target_direction ? (isHeatingHotend(target_extruder)) : (isCoolingHotend(target_extruder)&&(CooldownNoWait==false)) ) #endif //TEMP_RESIDENCY_TIME { // while loop if (millis() > timetemp + 1000UL) { //Print temp & remaining time every 1s while waiting SERIAL_PROTOCOLPGM("T:"); - SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1); + SERIAL_PROTOCOL_F(degHotend(target_extruder),1); SERIAL_PROTOCOLPGM(" E:"); - SERIAL_PROTOCOL((int)tmp_extruder); + SERIAL_PROTOCOL((int)target_extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { @@ -3198,9 +3204,9 @@ inline void gcode_M109() { #ifdef TEMP_RESIDENCY_TIME // start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time // or when current temp falls outside the hysteresis after target temp was reached - if ((residencyStart == -1 && target_direction && (degHotend(tmp_extruder) >= (degTargetHotend(tmp_extruder)-TEMP_WINDOW))) || - (residencyStart == -1 && !target_direction && (degHotend(tmp_extruder) <= (degTargetHotend(tmp_extruder)+TEMP_WINDOW))) || - (residencyStart > -1 && labs(degHotend(tmp_extruder) - degTargetHotend(tmp_extruder)) > TEMP_HYSTERESIS) ) + if ((residencyStart == -1 && target_direction && (degHotend(target_extruder) >= (degTargetHotend(target_extruder)-TEMP_WINDOW))) || + (residencyStart == -1 && !target_direction && (degHotend(target_extruder) <= (degTargetHotend(target_extruder)+TEMP_WINDOW))) || + (residencyStart > -1 && labs(degHotend(target_extruder) - degTargetHotend(target_extruder)) > TEMP_HYSTERESIS) ) { residencyStart = millis(); } @@ -3538,9 +3544,9 @@ inline void gcode_M121() { enable_endstops(true); } */ inline void gcode_M150() { SendColors( - code_seen('R') ? (byte)code_value() : 0, - code_seen('U') ? (byte)code_value() : 0, - code_seen('B') ? (byte)code_value() : 0 + code_seen('R') ? (byte)code_value_short() : 0, + code_seen('U') ? (byte)code_value_short() : 0, + code_seen('B') ? (byte)code_value_short() : 0 ); } @@ -3552,9 +3558,9 @@ inline void gcode_M121() { enable_endstops(true); } * D */ inline void gcode_M200() { - tmp_extruder = active_extruder; + int tmp_extruder = active_extruder; if (code_seen('T')) { - tmp_extruder = code_value(); + tmp_extruder = code_value_short(); if (tmp_extruder >= EXTRUDERS) { SERIAL_ECHO_START; SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER); @@ -3625,27 +3631,23 @@ inline void gcode_M203() { * Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate */ inline void gcode_M204() { - if (code_seen('S')) // Kept for legacy compatibility. Should NOT BE USED for new developments. - { + if (code_seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. acceleration = code_value(); travel_acceleration = acceleration; - SERIAL_ECHOPAIR("Setting Printing and Travelling Acceleration: ", acceleration ); + SERIAL_ECHOPAIR("Setting Print and Travel Acceleration: ", acceleration ); SERIAL_EOL; } - if (code_seen('P')) - { + if (code_seen('P')) { acceleration = code_value(); - SERIAL_ECHOPAIR("Setting Printing Acceleration: ", acceleration ); + SERIAL_ECHOPAIR("Setting Print Acceleration: ", acceleration ); SERIAL_EOL; } - if (code_seen('R')) - { + if (code_seen('R')) { retract_acceleration = code_value(); SERIAL_ECHOPAIR("Setting Retract Acceleration: ", retract_acceleration ); SERIAL_EOL; } - if (code_seen('T')) - { + if (code_seen('T')) { travel_acceleration = code_value(); SERIAL_ECHOPAIR("Setting Travel Acceleration: ", travel_acceleration ); SERIAL_EOL; @@ -3748,7 +3750,7 @@ inline void gcode_M206() { */ inline void gcode_M209() { if (code_seen('S')) { - int t = code_value(); + int t = code_value_short(); switch(t) { case 0: autoretract_enabled = false; @@ -3777,23 +3779,23 @@ inline void gcode_M206() { inline void gcode_M218() { if (setTargetedHotend(218)) return; - if (code_seen('X')) extruder_offset[X_AXIS][tmp_extruder] = code_value(); - if (code_seen('Y')) extruder_offset[Y_AXIS][tmp_extruder] = code_value(); + if (code_seen('X')) extruder_offset[X_AXIS][target_extruder] = code_value(); + if (code_seen('Y')) extruder_offset[Y_AXIS][target_extruder] = code_value(); #ifdef DUAL_X_CARRIAGE - if (code_seen('Z')) extruder_offset[Z_AXIS][tmp_extruder] = code_value(); + if (code_seen('Z')) extruder_offset[Z_AXIS][target_extruder] = code_value(); #endif SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - for (tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++) { - SERIAL_ECHO(" "); - SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]); - SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]); + for (int e = 0; e < EXTRUDERS; e++) { + SERIAL_CHAR(' '); + SERIAL_ECHO(extruder_offset[X_AXIS][e]); + SERIAL_CHAR(','); + SERIAL_ECHO(extruder_offset[Y_AXIS][e]); #ifdef DUAL_X_CARRIAGE - SERIAL_ECHO(","); - SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]); + SERIAL_CHAR(','); + SERIAL_ECHO(extruder_offset[Z_AXIS][e]); #endif } SERIAL_EOL; @@ -3816,7 +3818,7 @@ inline void gcode_M221() { int sval = code_value(); if (code_seen('T')) { if (setTargetedHotend(221)) return; - extruder_multiply[tmp_extruder] = sval; + extruder_multiply[target_extruder] = sval; } else { extruder_multiply[active_extruder] = sval; @@ -4047,7 +4049,7 @@ inline void gcode_M226() { * M250: Read and optionally set the LCD contrast */ inline void gcode_M250() { - if (code_seen('C')) lcd_setcontrast(code_value_long() & 0x3F); + if (code_seen('C')) lcd_setcontrast(code_value_short() & 0x3F); SERIAL_PROTOCOLPGM("lcd contrast value: "); SERIAL_PROTOCOL(lcd_contrast); SERIAL_PROTOCOLLN(""); @@ -4073,8 +4075,8 @@ inline void gcode_M226() { * C */ inline void gcode_M303() { - int e = code_seen('E') ? code_value_long() : 0; - int c = code_seen('C') ? code_value_long() : 5; + int e = code_seen('E') ? code_value_short() : 0; + int c = code_seen('C') ? code_value_short() : 5; float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0); PID_autotune(temp, e, c); } @@ -4483,13 +4485,13 @@ inline void gcode_M503() { if (code_seen('R')) duplicate_extruder_temp_offset = code_value(); SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); - SERIAL_ECHO(" "); + SERIAL_CHAR(' '); SERIAL_ECHO(extruder_offset[X_AXIS][0]); - SERIAL_ECHO(","); + SERIAL_CHAR(','); SERIAL_ECHO(extruder_offset[Y_AXIS][0]); - SERIAL_ECHO(" "); + SERIAL_CHAR(' '); SERIAL_ECHO(duplicate_extruder_x_offset); - SERIAL_ECHO(","); + SERIAL_CHAR(','); SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]); break; case DXC_FULL_CONTROL_MODE: @@ -4562,7 +4564,7 @@ inline void gcode_M907() { * S# determines MS1 or MS2, X# sets the pin high/low. */ inline void gcode_M351() { - if (code_seen('S')) switch(code_value_long()) { + if (code_seen('S')) switch(code_value_short()) { case 1: for(int i=0;i= EXTRUDERS) { SERIAL_ECHO_START; - SERIAL_ECHO("T"); + SERIAL_CHAR('T'); SERIAL_ECHO(tmp_extruder); SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); } else { + target_extruder = tmp_extruder; + #if EXTRUDERS > 1 bool make_move = false; #endif + if (code_seen('F')) { + #if EXTRUDERS > 1 make_move = true; #endif + next_feedrate = code_value(); if (next_feedrate > 0.0) feedrate = next_feedrate; } @@ -4692,7 +4699,7 @@ inline void gcode_T() { void process_commands() { if (code_seen('G')) { - int gCode = code_value_long(); + int gCode = code_value_short(); switch(gCode) { @@ -4767,7 +4774,7 @@ void process_commands() { } else if (code_seen('M')) { - switch( code_value_long() ) { + switch(code_value_short()) { #ifdef ULTIPANEL case 0: // M0 - Unconditional stop - Wait for user button press on LCD case 1: // M1 - Conditional stop - Wait for user button press on LCD @@ -5922,10 +5929,10 @@ void setPwmFrequency(uint8_t pin, int val) #endif //FAST_PWM_FAN bool setTargetedHotend(int code){ - tmp_extruder = active_extruder; - if(code_seen('T')) { - tmp_extruder = code_value(); - if(tmp_extruder >= EXTRUDERS) { + target_extruder = active_extruder; + if (code_seen('T')) { + target_extruder = code_value_short(); + if (target_extruder >= EXTRUDERS) { SERIAL_ECHO_START; switch(code){ case 104: @@ -5944,7 +5951,7 @@ bool setTargetedHotend(int code){ SERIAL_ECHO(MSG_M221_INVALID_EXTRUDER); break; } - SERIAL_ECHOLN(tmp_extruder); + SERIAL_ECHOLN(target_extruder); return true; } } diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index fae6c1be69..877b72b927 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -249,7 +249,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/) if (!myDir.open(curDir, subdirname, O_READ)) { SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(subdirname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); return; } else { @@ -287,14 +287,14 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/) else { SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); } } else { //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); } else { saving = true; @@ -330,7 +330,7 @@ void CardReader::removeFile(char* name) { if (!myDir.open(curDir, subdirname, O_READ)) { SERIAL_PROTOCOLPGM("open failed, File: "); SERIAL_PROTOCOL(subdirname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); return; } else { @@ -360,7 +360,7 @@ void CardReader::removeFile(char* name) { else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLLNPGM("."); + SERIAL_PROTOCOLCHAR('.'); } } @@ -368,7 +368,7 @@ void CardReader::getStatus() { if (cardOK) { SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE); SERIAL_PROTOCOL(sdpos); - SERIAL_PROTOCOLPGM("/"); + SERIAL_PROTOCOLCHAR('/'); SERIAL_PROTOCOLLN(filesize); } else { diff --git a/Marlin/vector_3.cpp b/Marlin/vector_3.cpp index 243f0838f0..9eb3465fbf 100644 --- a/Marlin/vector_3.cpp +++ b/Marlin/vector_3.cpp @@ -125,9 +125,9 @@ void matrix_3x3::debug(const char title[]) { int count = 0; for(int i=0; i<3; i++) { for(int j=0; j<3; j++) { - if (matrix[count] >= 0.0) SERIAL_PROTOCOLPGM("+"); + if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+'); SERIAL_PROTOCOL_F(matrix[count], 6); - SERIAL_PROTOCOLPGM(" "); + SERIAL_PROTOCOLCHAR(' '); count++; } SERIAL_EOL; From fc3c76fc1641370ee76a564299592e283cbcd0c0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 22:04:42 -0700 Subject: [PATCH 3/4] Fix #1800 --- Marlin/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index c0e427a655..0cddd08784 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -84,7 +84,7 @@ unsigned char soft_pwm_bed; static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0}; #endif #if HAS_BED_THERMAL_PROTECTION - static TRState thermal_runaway_bed_state_machine = { TRInactive, TRInactive, TRInactive, TRInactive }; + static TRState thermal_runaway_bed_state_machine = TRInactive; static unsigned long thermal_runaway_bed_timer; #endif #endif From 8680b515b00ab4bccb07883ba0be65f960a06973 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 3 Apr 2015 22:12:49 -0700 Subject: [PATCH 4/4] Fix missing tmp_extruder -> target_extruder --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ba37b42e91..d67f65367c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3059,9 +3059,9 @@ inline void gcode_M105() { SERIAL_PROTOCOLPGM("ok"); #if HAS_TEMP_0 SERIAL_PROTOCOLPGM(" T:"); - SERIAL_PROTOCOL_F(degHotend(tmp_extruder), 1); + SERIAL_PROTOCOL_F(degHotend(target_extruder), 1); SERIAL_PROTOCOLPGM(" /"); - SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder), 1); + SERIAL_PROTOCOL_F(degTargetHotend(target_extruder), 1); #endif #if HAS_TEMP_BED SERIAL_PROTOCOLPGM(" B:");