Browse Source

Add a sanity check for valid bed size

pull/1/head
Scott Lahteine 7 years ago
parent
commit
b2822a59f9
  1. 8
      Marlin/SanityCheck.h

8
Marlin/SanityCheck.h

@ -51,7 +51,7 @@
* Warnings for old configurations
*/
#if !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
#error "X_BED_SIZE and BED_Y_SIZE are now required! Please update your configuration."
#error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration."
#elif WATCH_TEMP_PERIOD > 500
#error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
#elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
@ -244,6 +244,12 @@
#error "Z_DUAL_STEPPER_DRIVERS requires Z2 pins (and an extra E plug)."
#endif
/**
* Validate that the bed size fits
*/
static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
"Movement bounds ([XY]_MIN_POS, [XY]_MAX_POS) are too narrow to contain [XY]_BED_SIZE.");
/**
* Progress Bar
*/

Loading…
Cancel
Save