Browse Source

General code cleanup, spacing

Scott Lahteine 7 years ago
parent
commit
9bbc2df217
4 changed files with 21 additions and 19 deletions
  1. 3
    1
      Marlin/Marlin.h
  2. 1
    1
      Marlin/Marlin_main.cpp
  3. 6
    6
      Marlin/serial.h
  4. 11
    11
      Marlin/ultralcd.cpp

+ 3
- 1
Marlin/Marlin.h View File

@@ -422,7 +422,9 @@ void do_blocking_move_to_x(const float &x, const float &fr_mm_s=0.0);
422 422
 void do_blocking_move_to_z(const float &z, const float &fr_mm_s=0.0);
423 423
 void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s=0.0);
424 424
 
425
-#if ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE)
425
+#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)))
426
+
427
+#if HAS_AXIS_UNHOMED_ERR
426 428
   bool axis_unhomed_error(const bool x=true, const bool y=true, const bool z=true);
427 429
 #endif
428 430
 

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -1822,7 +1822,7 @@ static void clean_up_after_endstop_or_probe_move() {
1822 1822
 
1823 1823
 #endif // HAS_BED_PROBE
1824 1824
 
1825
-#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)
1825
+#if HAS_AXIS_UNHOMED_ERR
1826 1826
 
1827 1827
   bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) {
1828 1828
     #if ENABLED(HOME_AFTER_DEACTIVATE)

+ 6
- 6
Marlin/serial.h View File

@@ -57,8 +57,8 @@ extern const char errormagic[] PROGMEM;
57 57
 #define SERIAL_ECHOPGM(x)              SERIAL_PROTOCOLPGM(x)
58 58
 #define SERIAL_ECHOLN(x)               SERIAL_PROTOCOLLN(x)
59 59
 #define SERIAL_ECHOLNPGM(x)            SERIAL_PROTOCOLLNPGM(x)
60
-#define SERIAL_ECHOPAIR(name,value)    SERIAL_PROTOCOLPAIR(name, value)
61
-#define SERIAL_ECHOLNPAIR(name, value) SERIAL_PROTOCOLLNPAIR(name, value)
60
+#define SERIAL_ECHOPAIR(pre,value)     SERIAL_PROTOCOLPAIR(pre, value)
61
+#define SERIAL_ECHOLNPAIR(pre,value)   SERIAL_PROTOCOLLNPAIR(pre, value)
62 62
 #define SERIAL_ECHO_F(x,y)             SERIAL_PROTOCOL_F(x,y)
63 63
 
64 64
 #define SERIAL_ERROR_START()           (serialprintPGM(errormagic))
@@ -68,10 +68,10 @@ extern const char errormagic[] PROGMEM;
68 68
 #define SERIAL_ERRORLNPGM(x)           SERIAL_PROTOCOLLNPGM(x)
69 69
 
70 70
 // These macros compensate for float imprecision
71
-#define SERIAL_PROTOCOLPAIR_F(name, value)    SERIAL_PROTOCOLPAIR(name, FIXFLOAT(value))
72
-#define SERIAL_PROTOCOLLNPAIR_F(name, value)  SERIAL_PROTOCOLLNPAIR(name, FIXFLOAT(value))
73
-#define SERIAL_ECHOPAIR_F(name,value)         SERIAL_ECHOPAIR(name, FIXFLOAT(value))
74
-#define SERIAL_ECHOLNPAIR_F(name, value)      SERIAL_ECHOLNPAIR(name, FIXFLOAT(value))
71
+#define SERIAL_PROTOCOLPAIR_F(pre, value)    SERIAL_PROTOCOLPAIR(pre, FIXFLOAT(value))
72
+#define SERIAL_PROTOCOLLNPAIR_F(pre, value)  SERIAL_PROTOCOLLNPAIR(pre, FIXFLOAT(value))
73
+#define SERIAL_ECHOPAIR_F(pre,value)         SERIAL_ECHOPAIR(pre, FIXFLOAT(value))
74
+#define SERIAL_ECHOLNPAIR_F(pre, value)      SERIAL_ECHOLNPAIR(pre, FIXFLOAT(value))
75 75
 
76 76
 void serial_echopair_P(const char* s_P, const char *v);
77 77
 void serial_echopair_P(const char* s_P, char v);

+ 11
- 11
Marlin/ultralcd.cpp View File

@@ -1029,11 +1029,11 @@ void kill_screen(const char* lcd_msg) {
1029 1029
     #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
1030 1030
 
1031 1031
       #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY)
1032
-        void _lcd_babystep_zoffset_overlay(float zprobe_zoffset) {
1032
+        void _lcd_babystep_zoffset_overlay(const float zprobe_zoffset) {
1033 1033
           // Determine whether the user is raising or lowering the nozzle.
1034 1034
           static int dir = 0;
1035 1035
           static float old_zprobe_zoffset = 0;
1036
-          if(zprobe_zoffset != old_zprobe_zoffset) {
1036
+          if (zprobe_zoffset != old_zprobe_zoffset) {
1037 1037
             dir = (zprobe_zoffset > old_zprobe_zoffset) ? 1 : -1;
1038 1038
             old_zprobe_zoffset = zprobe_zoffset;
1039 1039
           }
@@ -1047,21 +1047,21 @@ void kill_screen(const char* lcd_msg) {
1047 1047
           #endif
1048 1048
 
1049 1049
           #if ENABLED(USE_BIG_EDIT_FONT)
1050
-            const int left   = 0;
1051
-            const int right  = 45;
1052
-            const int nozzle = 95;
1050
+            const int left   = 0,
1051
+                      right  = 45,
1052
+                      nozzle = 95;
1053 1053
           #else
1054
-            const int left   = 5;
1055
-            const int right  = 90;
1056
-            const int nozzle = 60;
1054
+            const int left   = 5,
1055
+                      right  = 90,
1056
+                      nozzle = 60;
1057 1057
           #endif
1058 1058
 
1059 1059
           // Draw a representation of the nozzle
1060
-          if(PAGE_CONTAINS(3,16))  u8g.drawBitmapP(nozzle + 6, 4 - dir,2,12,nozzle_bmp);
1061
-          if(PAGE_CONTAINS(20,20)) u8g.drawBitmapP(nozzle + 0,20,3,1,offset_bedline_bmp);
1060
+          if (PAGE_CONTAINS(3, 16))  u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp);
1061
+          if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp);
1062 1062
 
1063 1063
           // Draw cw/ccw indicator and up/down arrows.
1064
-          if(PAGE_CONTAINS(47,62)) {
1064
+          if (PAGE_CONTAINS(47, 62)) {
1065 1065
             u8g.drawBitmapP(left  + 0, 47, 3, 16, rot_down);
1066 1066
             u8g.drawBitmapP(right + 0, 47, 3, 16, rot_up);
1067 1067
             u8g.drawBitmapP(right + 20, 48 - dir, 2, 13, up_arrow_bmp);

Loading…
Cancel
Save