0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-19 08:08:25 +00:00

🔧 Fix Linear Leveling grid size sanity check (#26199)

This commit is contained in:
Keith Bennett 2023-08-22 16:40:59 -07:00 committed by GitHub
parent 88cdf487b4
commit fb74caebb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1504,46 +1504,26 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
* Bed Leveling Requirements
*/
#if ENABLED(AUTO_BED_LEVELING_UBL)
/**
* Unified Bed Leveling
*/
#if IS_SCARA
#error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
#elif ENABLED(POLAR)
#if IS_SCARA && ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL)
#error "SCARA machines can only use AUTO_BED_LEVELING_BILINEAR or MESH_BED_LEVELING leveling."
#elif ENABLED(AUTO_BED_LEVELING_LINEAR) && !(WITHIN(GRID_MAX_POINTS_X, 2, 255) && WITHIN(GRID_MAX_POINTS_Y, 2, 255))
#error "GRID_MAX_POINTS_[XY] must be between 2 and 255 with AUTO_BED_LEVELING_LINEAR."
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) && !(WITHIN(GRID_MAX_POINTS_X, 3, 255) && WITHIN(GRID_MAX_POINTS_Y, 3, 255))
#error "GRID_MAX_POINTS_[XY] must be between 3 and 255 with AUTO_BED_LEVELING_BILINEAR."
#elif ENABLED(AUTO_BED_LEVELING_UBL)
#if ENABLED(POLAR)
#error "AUTO_BED_LEVELING_UBL does not yet support POLAR printers."
#elif DISABLED(EEPROM_SETTINGS)
#error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
#elif !WITHIN(GRID_MAX_POINTS_X, 3, 255) || !WITHIN(GRID_MAX_POINTS_Y, 3, 255)
#error "GRID_MAX_POINTS_[XY] must be between 3 and 255."
#endif
#elif HAS_ABL_NOT_UBL
/**
* Auto Bed Leveling
*/
/**
* Delta and SCARA have limited bed leveling options
*/
#if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR)
#error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option."
#elif ABL_USES_GRID && !(WITHIN(GRID_MAX_POINTS_X, 3, 255) && WITHIN(GRID_MAX_POINTS_Y, 3, 255))
#error "GRID_MAX_POINTS_[XY] must be between 3 and 255."
#endif
#elif ENABLED(MESH_BED_LEVELING)
// Mesh Bed Leveling
#if ENABLED(DELTA)
#error "MESH_BED_LEVELING is not compatible with DELTA printers."
#elif (GRID_MAX_POINTS_X) > 9 || (GRID_MAX_POINTS_Y) > 9
#error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL."
#endif
#endif
#define _POINT_COUNT (defined(PROBE_PT_1) + defined(PROBE_PT_2) + defined(PROBE_PT_3))