From c7a8f7970be3a57ca32f7704f6a2d87fddf8600a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 8 Apr 2017 01:53:22 -0500 Subject: [PATCH] Formatting / cleanup --- Marlin/Marlin_main.cpp | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 4290efa76..17ba73cf7 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1777,7 +1777,6 @@ static void clean_up_after_endstop_or_probe_move() { lcd_status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : ""); #endif return true; - } return false; } @@ -1974,7 +1973,7 @@ static void clean_up_after_endstop_or_probe_move() { #if HAS_BED_PROBE - // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed. + // TRIGGERED_WHEN_STOWED_TEST can easily be extended to servo probes, ... if needed. #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST) #if ENABLED(Z_MIN_PROBE_ENDSTOP) #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) @@ -1983,7 +1982,6 @@ static void clean_up_after_endstop_or_probe_move() { #endif #endif - #if ENABLED(BLTOUCH) void bltouch_command(int angle) { servo[Z_ENDSTOP_SERVO_NR].move(angle); // Give the BL-Touch the command and wait @@ -1995,7 +1993,7 @@ static void clean_up_after_endstop_or_probe_move() { bltouch_command(BLTOUCH_RESET); // try to reset it. bltouch_command(BLTOUCH_DEPLOY); // Also needs to deploy and stow to bltouch_command(BLTOUCH_STOW); // clear the triggered condition. - safe_delay(1500); // wait for internal self test to complete + safe_delay(1500); // wait for internal self test to complete // measured completion time was 0.65 seconds // after reset, deploy & stow sequence if (TEST_BLTOUCH()) { // If it still claims to be triggered... @@ -2206,8 +2204,7 @@ static void clean_up_after_endstop_or_probe_move() { // - Raise to the BETWEEN height // - Return the probed Z position // -//float probe_pt(const float &x, const float &y, const bool stow = true, const int verbose_level = 1) { - float probe_pt(const float x, const float y, const bool stow, const int verbose_level) { + float probe_pt(const float x, const float y, const bool stow/*=true*/, const int verbose_level/*=1*/) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_ECHOPAIR(">>> probe_pt(", x); @@ -2371,9 +2368,9 @@ static void clean_up_after_endstop_or_probe_move() { // // Enable if you prefer your output in JSON format // suitable for SCAD or JavaScript mesh visualizers. - // + // // Visualize meshes in OpenSCAD using the included script. - // + // // buildroot/shared/scripts/MarlinMesh.scad // //#define SCAD_MESH_OUTPUT @@ -5319,7 +5316,6 @@ inline void gcode_M42() { #include "pinsDebug.h" - inline void toggle_pins() { int pin, j, start = 0, I_flag = 0, end = NUM_DIGITAL_PINS - 1, wait = 500, repeat = 1; @@ -5452,7 +5448,7 @@ inline void gcode_M42() { if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected"); } // measure active signal length #endif - } // servo_probe_test + } // servo_probe_test /** * M43: Pin debug - report pin state, watch pins, toggle pins and servo probe test/report @@ -5481,7 +5477,6 @@ inline void gcode_M42() { * M43 S - Servo probe test * P - Probe index (optional - defaults to 0 */ - inline void gcode_M43() { if (code_seen('T')) { // must be first ot else it's "S" and "E" parameters will execute endstop or servo test @@ -5503,7 +5498,6 @@ inline void gcode_M42() { return; } - // Get the range of pins to test or watch int first_pin = 0, last_pin = NUM_DIGITAL_PINS - 1; if (code_seen('P')) { @@ -5558,7 +5552,6 @@ inline void gcode_M42() { report_pin_state_extended(pin, ignore_protection); } - #endif // PINS_DEBUGGING #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) @@ -6041,17 +6034,18 @@ inline void gcode_M105() { #endif - #ifndef MIN_COOLING_SLOPE_DEG - #define MIN_COOLING_SLOPE_DEG 1.50 - #endif - #ifndef MIN_COOLING_SLOPE_TIME - #define MIN_COOLING_SLOPE_TIME 60 - #endif - /** * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating. * Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling. */ + +#ifndef MIN_COOLING_SLOPE_DEG + #define MIN_COOLING_SLOPE_DEG 1.50 +#endif +#ifndef MIN_COOLING_SLOPE_TIME + #define MIN_COOLING_SLOPE_TIME 60 +#endif + inline void gcode_M109() { if (get_target_extruder_from_command(109)) return; @@ -6275,11 +6269,11 @@ inline void gcode_M109() { residency_start_ms = now; } - #endif //TEMP_BED_RESIDENCY_TIME > 0 + #endif // TEMP_BED_RESIDENCY_TIME > 0 // Prevent a wait-forever situation if R is misused i.e. M190 R0 if (wants_to_cool) { - // break after MIN_COOLING_SLOPE_TIME_BED seconds + // Break after MIN_COOLING_SLOPE_TIME_BED seconds // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) { if (old_temp - temp < MIN_COOLING_SLOPE_DEG_BED) break; @@ -6307,7 +6301,7 @@ inline void gcode_M110() { * M111: Set the debug level */ inline void gcode_M111() { - marlin_debug_flags = code_seen('S') ? code_value_byte() : (uint8_t) DEBUG_NONE; + marlin_debug_flags = code_seen('S') ? code_value_byte() : (uint8_t)DEBUG_NONE; const static char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO; const static char str_debug_2[] PROGMEM = MSG_DEBUG_INFO; @@ -7772,7 +7766,7 @@ void quickstop_stepper() { } #endif -#if ENABLED(MESH_BED_LEVELING) +#if ENABLED(MESH_BED_LEVELING) /** * M421: Set a single Mesh Bed Leveling Z coordinate * Use either 'M421 X Y Z' or 'M421 I J Z'