浏览代码

Add a sanity check for valid bed size

Scott Lahteine 7 年前
父节点
当前提交
b2822a59f9
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7
    1
      Marlin/SanityCheck.h

+ 7
- 1
Marlin/SanityCheck.h 查看文件

51
  * Warnings for old configurations
51
  * Warnings for old configurations
52
  */
52
  */
53
 #if !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
53
 #if !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
54
-  #error "X_BED_SIZE and BED_Y_SIZE are now required! Please update your configuration."
54
+  #error "X_BED_SIZE and Y_BED_SIZE are now required! Please update your configuration."
55
 #elif WATCH_TEMP_PERIOD > 500
55
 #elif WATCH_TEMP_PERIOD > 500
56
   #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
56
   #error "WATCH_TEMP_PERIOD now uses seconds instead of milliseconds."
57
 #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
57
 #elif DISABLED(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
245
 #endif
245
 #endif
246
 
246
 
247
 /**
247
 /**
248
+ * Validate that the bed size fits
249
+ */
250
+static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
251
+  "Movement bounds ([XY]_MIN_POS, [XY]_MAX_POS) are too narrow to contain [XY]_BED_SIZE.");
252
+
253
+/**
248
  * Progress Bar
254
  * Progress Bar
249
  */
255
  */
250
 #if ENABLED(LCD_PROGRESS_BAR)
256
 #if ENABLED(LCD_PROGRESS_BAR)

正在加载...
取消
保存