1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Up to 6 Tramming points (#20720)

This commit is contained in:
Markus 2021-01-09 01:42:08 +01:00 committed by GitHub
parent 8e1637a2cc
commit d4ac8bc67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -36,6 +36,9 @@ PGMSTR(point_name_3, TRAMMING_POINT_NAME_3);
PGMSTR(point_name_4, TRAMMING_POINT_NAME_4); PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
#ifdef TRAMMING_POINT_NAME_5 #ifdef TRAMMING_POINT_NAME_5
PGMSTR(point_name_5, TRAMMING_POINT_NAME_5); PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
#ifdef TRAMMING_POINT_NAME_6
PGMSTR(point_name_6, TRAMMING_POINT_NAME_6);
#endif
#endif #endif
#endif #endif
@ -45,6 +48,9 @@ PGM_P const tramming_point_name[] PROGMEM = {
, point_name_4 , point_name_4
#ifdef TRAMMING_POINT_NAME_5 #ifdef TRAMMING_POINT_NAME_5
, point_name_5 , point_name_5
#ifdef TRAMMING_POINT_NAME_6
, point_name_6
#endif
#endif #endif
#endif #endif
}; };

View File

@ -31,17 +31,20 @@
constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY; constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY;
#define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos) #define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos)
static_assert(G35_PROBE_COUNT >= 3, "TRAMMING_POINT_XY requires at least 3 XY positions."); static_assert(WITHIN(G35_PROBE_COUNT, 3, 6), "TRAMMING_POINT_XY requires between 3 and 6 XY positions.");
#define VALIDATE_TRAMMING_POINT(N) static_assert(N >= G35_PROBE_COUNT || Probe::build_time::can_reach(screws_tilt_adjust_pos[N]), \ #define VALIDATE_TRAMMING_POINT(N) static_assert(N >= G35_PROBE_COUNT || Probe::build_time::can_reach(screws_tilt_adjust_pos[N]), \
"TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.") "TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.")
VALIDATE_TRAMMING_POINT(0); VALIDATE_TRAMMING_POINT(1); VALIDATE_TRAMMING_POINT(2); VALIDATE_TRAMMING_POINT(3); VALIDATE_TRAMMING_POINT(4); VALIDATE_TRAMMING_POINT(0); VALIDATE_TRAMMING_POINT(1); VALIDATE_TRAMMING_POINT(2); VALIDATE_TRAMMING_POINT(3); VALIDATE_TRAMMING_POINT(4); VALIDATE_TRAMMING_POINT(5);
extern const char point_name_1[], point_name_2[], point_name_3[] extern const char point_name_1[], point_name_2[], point_name_3[]
#ifdef TRAMMING_POINT_NAME_4 #ifdef TRAMMING_POINT_NAME_4
, point_name_4[] , point_name_4[]
#ifdef TRAMMING_POINT_NAME_5 #ifdef TRAMMING_POINT_NAME_5
, point_name_5[] , point_name_5[]
#ifdef TRAMMING_POINT_NAME_6
, point_name_6[]
#endif
#endif #endif
#endif #endif
; ;
@ -56,6 +59,10 @@ extern const char point_name_1[], point_name_2[], point_name_3[]
#ifdef TRAMMING_POINT_NAME_5 #ifdef TRAMMING_POINT_NAME_5
#undef _NR_TRAM_NAMES #undef _NR_TRAM_NAMES
#define _NR_TRAM_NAMES 5 #define _NR_TRAM_NAMES 5
#ifdef TRAMMING_POINT_NAME_6
#undef _NR_TRAM_NAMES
#define _NR_TRAM_NAMES 6
#endif
#endif #endif
#endif #endif
#endif #endif