浏览代码

Make LOGICAL and RAW position macros ternary-compatible

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

+ 2
- 2
Marlin/Marlin.h 查看文件

@@ -294,8 +294,8 @@ void update_software_endstops(AxisEnum axis);
294 294
 extern float soft_endstop_min[XYZ];
295 295
 extern float soft_endstop_max[XYZ];
296 296
 
297
-#define LOGICAL_POSITION(POS, AXIS) (POS + home_offset[AXIS] + position_shift[AXIS])
298
-#define RAW_POSITION(POS, AXIS)     (POS - home_offset[AXIS] - position_shift[AXIS])
297
+#define LOGICAL_POSITION(POS, AXIS) ((POS) + home_offset[AXIS] + position_shift[AXIS])
298
+#define RAW_POSITION(POS, AXIS)     ((POS) - home_offset[AXIS] - position_shift[AXIS])
299 299
 #define LOGICAL_X_POSITION(POS)     LOGICAL_POSITION(POS, X_AXIS)
300 300
 #define LOGICAL_Y_POSITION(POS)     LOGICAL_POSITION(POS, Y_AXIS)
301 301
 #define LOGICAL_Z_POSITION(POS)     LOGICAL_POSITION(POS, Z_AXIS)

正在加载...
取消
保存