Browse Source

Fix for Meshpositions if printer has negative endstop positions

Hans Raaf 7 years ago
parent
commit
406a83ff2d
1 changed files with 20 additions and 4 deletions
  1. 20
    4
      Marlin/Configuration_adv.h

+ 20
- 4
Marlin/Configuration_adv.h View File

@@ -657,14 +657,30 @@
657 657
 // Below are the macros that are used to define the borders for the mesh area,
658 658
 // made available here for specialized needs, ie dual extruder setup.
659 659
 #if ENABLED(MESH_BED_LEVELING)
660
-  #define MESH_MIN_X (X_MIN_POS + MESH_INSET)
660
+  #if X_MIN_POS < 0
661
+    #define MESH_MIN_X (MESH_INSET)
662
+  #else
663
+    #define MESH_MIN_X (X_MIN_POS + (MESH_INSET))
664
+  #endif
661 665
   #define MESH_MAX_X (X_MAX_POS - (MESH_INSET))
662
-  #define MESH_MIN_Y (Y_MIN_POS + MESH_INSET)
666
+  #if Y_MIN_POS < 0
667
+    #define MESH_MIN_Y (MESH_INSET)
668
+  #else
669
+    #define MESH_MIN_Y (Y_MIN_POS + (MESH_INSET))
670
+  #endif
663 671
   #define MESH_MAX_Y (Y_MAX_POS - (MESH_INSET))
664 672
 #elif ENABLED(AUTO_BED_LEVELING_UBL)
665
-  #define UBL_MESH_MIN_X (X_MIN_POS + UBL_MESH_INSET)
673
+  #if X_MIN_POS < 0
674
+    #define UBL_MESH_MIN_X (UBL_MESH_INSET)
675
+  #else
676
+    #define UBL_MESH_MIN_X (X_MIN_POS + (UBL_MESH_INSET))
677
+  #endif
666 678
   #define UBL_MESH_MAX_X (X_MAX_POS - (UBL_MESH_INSET))
667
-  #define UBL_MESH_MIN_Y (Y_MIN_POS + UBL_MESH_INSET)
679
+  #if Y_MIN_POS < 0
680
+    #define UBL_MESH_MIN_Y (UBL_MESH_INSET)
681
+  #else
682
+    #define UBL_MESH_MIN_Y (Y_MIN_POS + (UBL_MESH_INSET))
683
+  #endif
668 684
   #define UBL_MESH_MAX_Y (Y_MAX_POS - (UBL_MESH_INSET))
669 685
 #endif
670 686
 

Loading…
Cancel
Save