Pārlūkot izejas kodu

Up to 6 Tramming points (#20720)

Markus 4 gadus atpakaļ
vecāks
revīzija
d4ac8bc67b
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
2 mainītis faili ar 15 papildinājumiem un 2 dzēšanām
  1. 6
    0
      Marlin/src/feature/tramming.cpp
  2. 9
    2
      Marlin/src/feature/tramming.h

+ 6
- 0
Marlin/src/feature/tramming.cpp Parādīt failu

36
   PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
36
   PGMSTR(point_name_4, TRAMMING_POINT_NAME_4);
37
   #ifdef TRAMMING_POINT_NAME_5
37
   #ifdef TRAMMING_POINT_NAME_5
38
     PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
38
     PGMSTR(point_name_5, TRAMMING_POINT_NAME_5);
39
+    #ifdef TRAMMING_POINT_NAME_6
40
+      PGMSTR(point_name_6, TRAMMING_POINT_NAME_6);
41
+    #endif
39
   #endif
42
   #endif
40
 #endif
43
 #endif
41
 
44
 
45
     , point_name_4
48
     , point_name_4
46
     #ifdef TRAMMING_POINT_NAME_5
49
     #ifdef TRAMMING_POINT_NAME_5
47
       , point_name_5
50
       , point_name_5
51
+      #ifdef TRAMMING_POINT_NAME_6
52
+        , point_name_6
53
+      #endif
48
     #endif
54
     #endif
49
   #endif
55
   #endif
50
 };
56
 };

+ 9
- 2
Marlin/src/feature/tramming.h Parādīt failu

31
 constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY;
31
 constexpr xy_pos_t screws_tilt_adjust_pos[] = TRAMMING_POINT_XY;
32
 
32
 
33
 #define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos)
33
 #define G35_PROBE_COUNT COUNT(screws_tilt_adjust_pos)
34
-static_assert(G35_PROBE_COUNT >= 3, "TRAMMING_POINT_XY requires at least 3 XY positions.");
34
+static_assert(WITHIN(G35_PROBE_COUNT, 3, 6), "TRAMMING_POINT_XY requires between 3 and 6 XY positions.");
35
 
35
 
36
 #define VALIDATE_TRAMMING_POINT(N) static_assert(N >= G35_PROBE_COUNT || Probe::build_time::can_reach(screws_tilt_adjust_pos[N]), \
36
 #define VALIDATE_TRAMMING_POINT(N) static_assert(N >= G35_PROBE_COUNT || Probe::build_time::can_reach(screws_tilt_adjust_pos[N]), \
37
   "TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.")
37
   "TRAMMING_POINT_XY point " STRINGIFY(N) " is not reachable with the default NOZZLE_TO_PROBE offset and PROBING_MARGIN.")
38
-VALIDATE_TRAMMING_POINT(0); VALIDATE_TRAMMING_POINT(1); VALIDATE_TRAMMING_POINT(2); VALIDATE_TRAMMING_POINT(3); VALIDATE_TRAMMING_POINT(4);
38
+VALIDATE_TRAMMING_POINT(0); VALIDATE_TRAMMING_POINT(1); VALIDATE_TRAMMING_POINT(2); VALIDATE_TRAMMING_POINT(3); VALIDATE_TRAMMING_POINT(4); VALIDATE_TRAMMING_POINT(5);
39
 
39
 
40
 extern const char point_name_1[], point_name_2[], point_name_3[]
40
 extern const char point_name_1[], point_name_2[], point_name_3[]
41
   #ifdef TRAMMING_POINT_NAME_4
41
   #ifdef TRAMMING_POINT_NAME_4
42
     , point_name_4[]
42
     , point_name_4[]
43
     #ifdef TRAMMING_POINT_NAME_5
43
     #ifdef TRAMMING_POINT_NAME_5
44
       , point_name_5[]
44
       , point_name_5[]
45
+      #ifdef TRAMMING_POINT_NAME_6
46
+        , point_name_6[]
47
+      #endif
45
     #endif
48
     #endif
46
   #endif
49
   #endif
47
 ;
50
 ;
56
     #ifdef TRAMMING_POINT_NAME_5
59
     #ifdef TRAMMING_POINT_NAME_5
57
       #undef _NR_TRAM_NAMES
60
       #undef _NR_TRAM_NAMES
58
       #define _NR_TRAM_NAMES 5
61
       #define _NR_TRAM_NAMES 5
62
+      #ifdef TRAMMING_POINT_NAME_6
63
+        #undef _NR_TRAM_NAMES
64
+        #define _NR_TRAM_NAMES 6
65
+      #endif
59
     #endif
66
     #endif
60
   #endif
67
   #endif
61
 #endif
68
 #endif

Notiek ielāde…
Atcelt
Saglabāt