diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e9afbbb76d..0cd5a6433c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1107,12 +1107,15 @@ //#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment /** - * Screw thread: - * M3: 30 = Clockwise, 31 = Counter-Clockwise - * M4: 40 = Clockwise, 41 = Counter-Clockwise - * M5: 50 = Clockwise, 51 = Counter-Clockwise + * Screw Thread. Use one of the following defines: + * + * M3_CW = M3 Clockwise, M3_CCW = M3 Counter-Clockwise + * M4_CW = M3 Clockwise, M4_CCW = M4 Counter-Clockwise + * M5_CW = M3 Clockwise, M5_CCW = M5 Counter-Clockwise + * + * :{'M3_CW':'M3 Clockwise','M3_CCW':'M3 Counter-Clockwise','M4_CW':'M4 Clockwise','M4_CCW':'M4 Counter-Clockwise','M5_CW':'M5 Clockwise','M5_CCW':'M5 Counter-Clockwise'} */ - #define TRAMMING_SCREW_THREAD 30 + #define TRAMMING_SCREW_THREAD M3_CW #endif diff --git a/Marlin/src/feature/tramming.h b/Marlin/src/feature/tramming.h index c8f20f0010..de4c6c020c 100644 --- a/Marlin/src/feature/tramming.h +++ b/Marlin/src/feature/tramming.h @@ -24,9 +24,16 @@ #include "../inc/MarlinConfig.h" #include "../module/probe.h" -#if !WITHIN(TRAMMING_SCREW_THREAD, 30, 51) || TRAMMING_SCREW_THREAD % 10 > 1 - #error "TRAMMING_SCREW_THREAD must be equal to 30, 31, 40, 41, 50, or 51." -#endif +enum TrammingThread : uint8_t { + M3_CW = 30, M3_CCW = 31, + M4_CW = 40, M4_CCW = 41, + M5_CW = 50, M5_CCW = 51 +}; + +static_assert( + TRAMMING_SCREW_THREAD < 60 && TRAMMING_SCREW_THREAD % 10 < 2, + "TRAMMING_SCREW_THREAD must be M3_CW, M3_CCW, M4_CW, M4_CCW, M5_CW, or M5_CCW." +); constexpr xy_pos_t tramming_points[] = TRAMMING_POINT_XY;