From 9bbc2df21732d53a307b180948ee7c4a0a03be52 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 24 Sep 2017 15:05:27 -0500 Subject: [PATCH] General code cleanup, spacing --- Marlin/Marlin.h | 4 +++- Marlin/Marlin_main.cpp | 2 +- Marlin/serial.h | 12 ++++++------ Marlin/ultralcd.cpp | 22 +++++++++++----------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 54fbd4901..f1195dcbc 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -422,7 +422,9 @@ void do_blocking_move_to_x(const float &x, const float &fr_mm_s=0.0); void do_blocking_move_to_z(const float &z, const float &fr_mm_s=0.0); void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s=0.0); -#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) +#define HAS_AXIS_UNHOMED_ERR (ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || (ENABLED(ADVANCED_PAUSE_FEATURE) && ENABLED(HOME_BEFORE_FILAMENT_CHANGE))) + +#if HAS_AXIS_UNHOMED_ERR bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true); #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a5484a3b1..11c68b985 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1822,7 +1822,7 @@ static void clean_up_after_endstop_or_probe_move() { #endif // HAS_BED_PROBE -#if HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || ENABLED(DELTA_AUTO_CALIBRATION) +#if HAS_AXIS_UNHOMED_ERR bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) { #if ENABLED(HOME_AFTER_DEACTIVATE) diff --git a/Marlin/serial.h b/Marlin/serial.h index 8be90c06a..a4b6799dd 100644 --- a/Marlin/serial.h +++ b/Marlin/serial.h @@ -57,8 +57,8 @@ extern const char errormagic[] PROGMEM; #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_PROTOCOLPAIR(name, value) -#define SERIAL_ECHOLNPAIR(name, value) SERIAL_PROTOCOLLNPAIR(name, value) +#define SERIAL_ECHOPAIR(pre,value) SERIAL_PROTOCOLPAIR(pre, value) +#define SERIAL_ECHOLNPAIR(pre,value) SERIAL_PROTOCOLLNPAIR(pre, value) #define SERIAL_ECHO_F(x,y) SERIAL_PROTOCOL_F(x,y) #define SERIAL_ERROR_START() (serialprintPGM(errormagic)) @@ -68,10 +68,10 @@ extern const char errormagic[] PROGMEM; #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x) // These macros compensate for float imprecision -#define SERIAL_PROTOCOLPAIR_F(name, value) SERIAL_PROTOCOLPAIR(name, FIXFLOAT(value)) -#define SERIAL_PROTOCOLLNPAIR_F(name, value) SERIAL_PROTOCOLLNPAIR(name, FIXFLOAT(value)) -#define SERIAL_ECHOPAIR_F(name,value) SERIAL_ECHOPAIR(name, FIXFLOAT(value)) -#define SERIAL_ECHOLNPAIR_F(name, value) SERIAL_ECHOLNPAIR(name, FIXFLOAT(value)) +#define SERIAL_PROTOCOLPAIR_F(pre, value) SERIAL_PROTOCOLPAIR(pre, FIXFLOAT(value)) +#define SERIAL_PROTOCOLLNPAIR_F(pre, value) SERIAL_PROTOCOLLNPAIR(pre, FIXFLOAT(value)) +#define SERIAL_ECHOPAIR_F(pre,value) SERIAL_ECHOPAIR(pre, FIXFLOAT(value)) +#define SERIAL_ECHOLNPAIR_F(pre, value) SERIAL_ECHOLNPAIR(pre, FIXFLOAT(value)) void serial_echopair_P(const char* s_P, const char *v); void serial_echopair_P(const char* s_P, char v); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index d6de271e5..0c03dc06d 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1029,11 +1029,11 @@ void kill_screen(const char* lcd_msg) { #if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) - void _lcd_babystep_zoffset_overlay(float zprobe_zoffset) { + void _lcd_babystep_zoffset_overlay(const float zprobe_zoffset) { // Determine whether the user is raising or lowering the nozzle. static int dir = 0; static float old_zprobe_zoffset = 0; - if(zprobe_zoffset != old_zprobe_zoffset) { + if (zprobe_zoffset != old_zprobe_zoffset) { dir = (zprobe_zoffset > old_zprobe_zoffset) ? 1 : -1; old_zprobe_zoffset = zprobe_zoffset; } @@ -1047,21 +1047,21 @@ void kill_screen(const char* lcd_msg) { #endif #if ENABLED(USE_BIG_EDIT_FONT) - const int left = 0; - const int right = 45; - const int nozzle = 95; + const int left = 0, + right = 45, + nozzle = 95; #else - const int left = 5; - const int right = 90; - const int nozzle = 60; + const int left = 5, + right = 90, + nozzle = 60; #endif // Draw a representation of the nozzle - if(PAGE_CONTAINS(3,16)) u8g.drawBitmapP(nozzle + 6, 4 - dir,2,12,nozzle_bmp); - if(PAGE_CONTAINS(20,20)) u8g.drawBitmapP(nozzle + 0,20,3,1,offset_bedline_bmp); + if (PAGE_CONTAINS(3, 16)) u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp); + if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp); // Draw cw/ccw indicator and up/down arrows. - if(PAGE_CONTAINS(47,62)) { + if (PAGE_CONTAINS(47, 62)) { u8g.drawBitmapP(left + 0, 47, 3, 16, rot_down); u8g.drawBitmapP(right + 0, 47, 3, 16, rot_up); u8g.drawBitmapP(right + 20, 48 - dir, 2, 13, up_arrow_bmp);