-
Notifications
You must be signed in to change notification settings - Fork 371
Expand file tree
/
Copy pathProjectOptions.cmake
More file actions
1272 lines (1185 loc) · 34.1 KB
/
Copy pathProjectOptions.cmake
File metadata and controls
1272 lines (1185 loc) · 34.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Command Line Options
#
# You should specify those options when invoking CMake. Example:
# ~~~
# cmake .. <other options> -DPRINTER=MINI
# ~~~
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(PRINTER_VALID_OPTS
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"MINI"
"MK4"
"MK3.5"
"XL"
"iX"
"XL_DEV_KIT"
"NONE"
)
set(BOARD_VALID_OPTS
"BUDDY"
"XBUDDY"
"XLBUDDY"
"DWARF"
"MODULARBED"
"XL_DEV_KIT_XLB"
"XBUDDY_EXTENSION"
"ANFC"
"TOOL_OFFSET_SENSOR"
"INDX_HEAD"
)
set(MCU_VALID_OPTS
"<default>"
"STM32F407VG"
"STM32F429VI"
"STM32F427ZI"
"STM32G070RBT6"
"STM32H503CBU7"
"STM32C092KCUX"
)
set(BOOTLOADER_VALID_OPTS "NO" "EMPTY" "YES")
set(TRANSLATIONS_ENABLED_VALID_OPTS "<default>" "NO" "YES")
set(TOUCH_ENABLED_VALID_OPTS "<default>" "NO" "YES")
set(BUDDY_BOARDS "BUDDY" "XBUDDY" "XLBUDDY")
set(PRINTER
"MINI"
CACHE
STRING
"Select the printer for which you want to compile the project (valid values are ${PRINTER_VALID_OPTS})."
)
set(BOOTLOADER
"NO"
CACHE STRING "Selects the bootloader mode (valid values are ${BOOTLOADER_VALID_OPTS})."
)
set(BOARD
"<invalid>"
CACHE
STRING
"Select the board for which you want to compile the project (valid values are ${BOARD_VALID_OPTS})."
)
set(MCU
"<default>"
CACHE
STRING
"Select the MCU for which you want to compile the project (valid values are ${MCU_VALID_OPTS})."
)
set(SIGNING_KEY
""
CACHE FILEPATH "Path to a PEM EC private key to be used to sign the firmware."
)
set(PROJECT_VERSION_SUFFIX
"<auto>"
CACHE
STRING
"Full version suffix to be shown on the info screen in settings (e.g. full_version=4.0.3-BETA+1035.PR111.B4, suffix=-BETA+1035.PR111.B4). Defaults to '+<commit sha>.<dirty?>.<debug?>' if set to '<auto>'."
)
set(PROJECT_VERSION_SUFFIX_SHORT
"<auto>"
CACHE
STRING
"Short version suffix to be shown on splash screen. Defaults to '+<BUILD_NUMBER>' if set to '<auto>'."
)
set(BUILD_NUMBER
""
CACHE STRING "Build number of the firmware. Resolved automatically if not specified."
)
set(CUSTOM_COMPILE_OPTIONS
""
CACHE STRING "Allows adding custom C/C++ flags"
)
set(SIGNATURE_OAK
"OFF"
CACHE BOOL "Build Signature Oak variant (luxury limited edition with brass UI theme)"
)
if(SIGNATURE_OAK AND NOT PRINTER STREQUAL "COREONE")
message(FATAL_ERROR "SIGNATURE_OAK is only supported for COREONE builds")
endif()
define_boolean_option(SIGNATURE_OAK ${SIGNATURE_OAK})
if(${BOARD} STREQUAL "XL_DEV_KIT_XLB")
set(WUI
"NO"
CACHE BOOL "Enable Web User Interface"
)
else()
set(WUI
"YES"
CACHE BOOL "Enable Web User Interface"
)
endif()
define_boolean_option("BUDDY_ENABLE_WUI" ${WUI})
set(RESOURCES
"<auto>"
CACHE
STRING
"Enable resources (managed files on external flash). Set to '<auto>' to enable according to 'PRINTERS_WITH_RESOURCES'."
)
set(TRANSLATIONS_ENABLED
"<default>"
CACHE STRING "Enable languages (NO == English only)"
)
set(TRANSLATIONS_LIST
"<default>"
CACHE STRING "List of languages to enable"
)
set(TOUCH_ENABLED
"<default>"
CACHE STRING "Enable touch (valid values are ${TOUCH_ENABLED_VALID_OPTS})."
)
set(DEVELOPMENT_ITEMS_ENABLED
"YES"
CACHE BOOL "Show development (green) items in menus and enable other devel features"
)
define_boolean_option(DEVELOPMENT_ITEMS ${DEVELOPMENT_ITEMS_ENABLED})
set(ENABLE_BURST
"NO"
CACHE BOOL "Enable BURST stepping on supported printers."
)
# Validate options
foreach(OPTION "PRINTER" "BOARD" "MCU" "BOOTLOADER" "TRANSLATIONS_ENABLED" "TOUCH_ENABLED")
if(NOT ${OPTION} IN_LIST ${OPTION}_VALID_OPTS)
message(FATAL_ERROR "Invalid ${OPTION} ${${OPTION}}: Valid values are ${${OPTION}_VALID_OPTS}")
endif()
endforeach()
# define simple options
define_boolean_option(BOOTLOADER ${BOOTLOADER})
# Set BOARD_IS_MASTER_BOARD - means main board of entire printer, non-main board are puppies
if(BOARD IN_LIST BUDDY_BOARDS OR BOARD STREQUAL "XL_DEV_KIT_XLB")
set(BOARD_IS_MASTER_BOARD true)
else()
set(BOARD_IS_MASTER_BOARD false)
endif()
define_boolean_option(BOARD_IS_MASTER_BOARD ${BOARD_IS_MASTER_BOARD})
# set MCU to its default if not specified
if(${MCU} STREQUAL "<default>")
if(${BOARD} STREQUAL "BUDDY")
if(${PRINTER} MATCHES "^(XL)$")
set(MCU "STM32F429VI")
else()
set(MCU "STM32F407VG")
endif()
elseif(${BOARD} STREQUAL "XBUDDY")
set(MCU "STM32F427ZI")
elseif(${BOARD} STREQUAL "XLBUDDY")
set(MCU "STM32F427ZI")
elseif(${BOARD} STREQUAL "XL_DEV_KIT_XLB")
set(MCU "STM32F427ZI") # todo
elseif(${BOARD} STREQUAL "DWARF")
set(MCU "STM32G070RBT6")
elseif(${BOARD} STREQUAL "MODULARBED")
set(MCU "STM32G070RBT6")
elseif(${BOARD} STREQUAL "XBUDDY_EXTENSION")
set(MCU "STM32H503CBU7")
elseif(${BOARD} STREQUAL "ANFC")
set(MCU "STM32C092KCUX")
elseif(${BOARD} STREQUAL "TOOL_OFFSET_SENSOR")
set(MCU "STM32C092KCUX")
elseif(${BOARD} STREQUAL "INDX_HEAD")
set(MCU "STM32C092KCUX")
else()
message(FATAL_ERROR "Don't know what MCU to set as default for this board/version")
endif()
endif()
# define MCU option
list(REMOVE_ITEM MCU_VALID_OPTS "<default>")
define_enum_option(NAME MCU VALUE ${MCU} ALL_VALUES ${MCU_VALID_OPTS})
# Set connect status/availability
if(${BOARD} STREQUAL "DWARF"
OR ${BOARD} STREQUAL "MODULARBED"
OR ${BOARD} STREQUAL "XBUDDY_EXTENSION"
OR ${BOARD} STREQUAL "ANFC"
OR ${BOARD} STREQUAL "INDX_HEAD"
OR ${BOARD} STREQUAL "XL_DEV_KIT_XLB"
OR ${BOARD} STREQUAL "TOOL_OFFSET_SENSOR"
)
set(CONNECT
"NO"
CACHE BOOL "Enable Connect client"
)
else()
set(CONNECT
"YES"
CACHE BOOL "Enable Connect client"
)
endif()
define_boolean_option(BUDDY_ENABLE_CONNECT ${CONNECT})
# Resolve BUILD_NUMBER and PROJECT_VERSION_* variables
resolve_version_variables()
# Inform user about the resolved settings
message(STATUS "Project version: ${PROJECT_VERSION}")
message(STATUS "Project version with full suffix: ${PROJECT_VERSION_FULL}")
message(
STATUS "Project version with short suffix: ${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX_SHORT}"
)
message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}.")
message(STATUS "Bootloader: ${BOOTLOADER}")
message(STATUS "Printer: ${PRINTER}")
message(STATUS "Board: ${BOARD}")
message(STATUS "MCU: ${MCU}")
message(STATUS "Custom Compile Options (C/C++ flags): ${CUSTOM_COMPILE_OPTIONS}")
message(STATUS "Web User Interface: ${WUI}")
message(STATUS "Connect client: ${CONNECT}")
message(STATUS "Resources: ${RESOURCES}")
# Set printer features
function(set_feature_for_printers FEATURE_NAME)
set(FEATURE_PRINTER_LIST ${ARGV})
list(REMOVE_AT FEATURE_PRINTER_LIST 0) # First argument is the feature name
if(DEFINED ${FEATURE_NAME})
# override from manual configuration
set(FEATURE_VALUE ${${FEATURE_NAME}})
elseif(${PRINTER} IN_LIST FEATURE_PRINTER_LIST)
# set from feature list
set(FEATURE_VALUE YES)
elseif("UNITTESTS" IN_LIST FEATURE_PRINTER_LIST AND UNITTESTS_ENABLE)
set(FEATURE_VALUE YES)
else()
set(FEATURE_VALUE NO)
endif()
set(${FEATURE_NAME}
${FEATURE_VALUE}
PARENT_SCOPE
)
define_boolean_option(${FEATURE_NAME} ${FEATURE_VALUE})
endfunction()
function(set_feature_for_printers_master_board FEATURE_NAME)
set(FEATURE_PRINTER_LIST ${ARGV})
list(REMOVE_AT FEATURE_PRINTER_LIST 0) # First argument is the feature name
if(BOARD_IS_MASTER_BOARD)
if(DEFINED ${FEATURE_NAME})
# override from manual configuration
set(FEATURE_VALUE ${${FEATURE_NAME}})
elseif(${PRINTER} IN_LIST FEATURE_PRINTER_LIST)
# set from feature list
set(FEATURE_VALUE YES)
elseif("UNITTESTS" IN_LIST FEATURE_PRINTER_LIST AND UNITTESTS_ENABLE)
set(FEATURE_VALUE YES)
else()
set(FEATURE_VALUE NO)
endif()
else()
set(FEATURE_VALUE NO)
endif()
set(${FEATURE_NAME}
${FEATURE_VALUE}
PARENT_SCOPE
)
define_boolean_option(${FEATURE_NAME} ${FEATURE_VALUE})
endfunction()
set(PRINTERS_WITH_FILAMENT_SENSOR_BINARY "MINI" "MK3.5")
set(PRINTERS_WITH_FILAMENT_SENSOR_ADC "MK4" "XL" "iX" "XL_DEV_KIT" "COREONE" "COREONEL")
set_feature_for_printers(
HAS_TRINAMIC
"MINI"
"MK4"
"MK3.5"
"iX"
"XL"
"XL_DEV_KIT"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers_master_board(
HAS_PAUSE
"MINI"
"MK4"
"MK3.5"
"iX"
"XL"
"XL_DEV_KIT"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
# CRASH_DETECTION requires SELFTEST to work
set_feature_for_printers_master_board(
HAS_CRASH_DETECTION
"MINI"
"MK4"
"MK3.5"
"iX"
"XL"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
# Detection of fallen tools
set_feature_for_printers_master_board(HAS_TOOL_CRASH_RECOVERY "XL" "COREONE_INDX" "COREONEL_INDX")
# POWER_PANIC requires SELFTEST and CRASH_DETECTION to work
set_feature_for_printers_master_board(
HAS_POWER_PANIC
"MK4"
"MK3.5"
"iX"
"XL"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
define_enum_option(NAME POWER_PANIC_STORAGE VALUE FLASH ALL_VALUES "FLASH;BKPSRAM")
# Probing for the print sheet during Z_SAFE_HOMING
set_feature_for_printers_master_board(
HAS_PRINT_SHEET_DETECTION
"MK4"
"iX"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers(HAS_PRECISE_HOMING "MK4" "MK3.5")
set_feature_for_printers(
HAS_SELFTEST_DEPENDENCIES "COREONE" "COREONEL" "COREONE_INDX" "COREONEL_INDX" "XL"
)
set_feature_for_printers(
HAS_PRECISE_HOMING_COREXY
"iX"
"XL"
"XL_DEV_KIT"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers(
HAS_SWITCHABLE_HOMING_CALIBRATION "iX" "XL" "XL_DEV_KIT" "COREONE" "COREONEL"
)
set_feature_for_printers_master_board(
HAS_PHASE_STEPPING
"XL"
"iX"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"MK4"
)
set_feature_for_printers_master_board(
HAS_PHASE_STEPPING_SELFTEST "iX" "XL" "COREONE_INDX" "COREONEL" "COREONEL_INDX"
)
set_feature_for_printers_master_board(
HAS_PHASE_STEPPING_CALIBRATION
"XL"
"iX"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"MK4"
)
set(PRINTERS_WITH_BURST_STEPPING
"XL"
"MK4"
"iX"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers_master_board(
HAS_INPUT_SHAPER_CALIBRATION
"MK4"
"MK3.5"
"XL"
"XL_DEV_KIT"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers(
HAS_SELFTEST
"MK4"
"MK3.5"
"XL"
"iX"
"MINI"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
# Heater selftest done as a gcode-based FSM wizard (M1987) instead of the legacy mask-based
# CSelftest state machine. All selftest printers except XL (which keeps the legacy path).
set_feature_for_printers(
HAS_HEATERS_SELFTEST_GCODE
"MK4"
"MK3.5"
"iX"
"MINI"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
# Bed heater fail -> "refit the steel sheet and retry" prompt (legacy: MK4 / MK3.5 / MINI).
set_feature_for_printers(HAS_HEATERS_SELFTEST_BED_SHEET_RETRY "MK4" "MK3.5" "MINI")
# Nozzle heater fail -> "revise printer setup" (ScreenPrinterSetup) prompt. Legacy had this only on
# MK4 / MK3.5; MINI offered just the bed-sheet retry above.
set_feature_for_printers(HAS_HEATERS_SELFTEST_REVISE "MK4" "MK3.5")
set_feature_for_printers(
HAS_HUMAN_INTERACTIONS
"MINI"
"MK4"
"MK3.5"
"XL"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers_master_board(
HAS_LOADCELL
"MK4"
"iX"
"XL"
"XL_DEV_KIT"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers_master_board(
HAS_NEXTRUDER
"MK4"
"iX"
"XL"
"XL_DEV_KIT"
"COREONE"
"COREONEL"
)
# Compensation of the nozzle thermal expansion between bed leveling and printing
set_feature_for_printers_master_board(HAS_NOZZLE_THERMAL_COMPENSATION "XL")
set_feature_for_printers_master_board(HAS_SHEET_PROFILES "MK3.5" "MINI")
set_feature_for_printers_master_board(
HAS_HEATBREAK_TEMP
"MK4"
"iX"
"XL"
"XL_DEV_KIT"
"COREONE"
"COREONEL"
)
set_feature_for_printers_master_board(HAS_FILAMENT_HEATBREAK_PARAM "iX")
set_feature_for_printers_master_board(
HAS_FILAMENT_BASE_PRESET_PARAM "COREONE_INDX" "COREONEL_INDX" "iX"
)
set(PRINTERS_WITH_RESOURCES
"MINI"
"MK4"
"MK3.5"
"XL"
"iX"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers(HAS_BOWDEN "MINI")
set(PRINTERS_WITH_DWARF "XL" "XL_DEV_KIT")
# MODULAR_BED is a bed consisting of several bedlets
set_feature_for_printers_master_board(HAS_MODULAR_BED "iX" "XL" "XL_DEV_KIT")
# REMOTE_BED means there is a daughterboard controlling the bed
set_feature_for_printers_master_board(
HAS_REMOTE_BED "iX" "XL" "XL_DEV_KIT" "COREONEL" "COREONEL_INDX"
)
# LOCAL_BED means the motherboard is directly controlling the bed
set_feature_for_printers_master_board(HAS_LOCAL_BED "COREONE" "COREONE_INDX" "MINI" "MK4" "MK3.5")
# PUPPY_MODULARBED is remote modular bed implemented as a puppy, i.e. communicating over modbus
set_feature_for_printers_master_board(HAS_PUPPY_MODULARBED "iX" "XL" "XL_DEV_KIT")
set_feature_for_printers_master_board(
HAS_XBUDDY_EXTENSION "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX" "iX"
)
if(NOT HAS_XBUDDY_EXTENSION OR NOT DEFINED XBUDDY_EXTENSION_VARIANT)
set(XBUDDY_EXTENSION_VARIANT "NONE")
endif()
define_enum_option(
NAME XBUDDY_EXTENSION_VARIANT VALUE "${XBUDDY_EXTENSION_VARIANT}" ALL_VALUES "NONE;STANDARD;iX"
)
# MK4 technically doesn't have door sensor but needs to check valid FW-HW
set_feature_for_printers_master_board(
HAS_DOOR_SENSOR "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX" "MK4"
)
set_feature_for_printers_master_board(
HAS_TOOLCHANGER "XL" "XL_DEV_KIT" "COREONE_INDX" "COREONEL_INDX"
)
set_feature_for_printers(
HAS_SIDE_FSENSOR
"iX"
"XL"
"COREONE"
"COREONEL"
"COREONE_INDX"
"COREONEL_INDX"
)
set_feature_for_printers(HAS_ADC_SIDE_FSENSOR "XL")
set_feature_for_printers(HAS_SIDE_FSENSOR_INVERTIBLE "COREONE_INDX" "COREONEL_INDX")
set_feature_for_printers(HAS_FSENSOR_INVERTIBLE)
set_feature_for_printers_master_board(HAS_SIDE_FSENSOR_REMAP "XL")
set_feature_for_printers(
HAS_FILAMENT_SENSORS_MENU "XL" "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX"
)
set_feature_for_printers(
HAS_ESP
"MK4"
"MK3.5"
"XL"
"MINI"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers(HAS_EMBEDDED_ESP32 "XL")
set_feature_for_printers_master_board(HAS_INTERNAL_STORAGE_FLASH "iX")
set(PRINTERS_WITH_SIDE_LEDS "XL" "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX")
set(PRINTERS_WITH_TRANSLATIONS
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"MK4"
"MK3.5"
"XL"
"MINI"
)
set_feature_for_printers(HAS_LOVE_BOARD "MK4" "iX" "COREONE" "COREONEL")
set_feature_for_printers(HAS_TMC_UART "MINI")
set_feature_for_printers(
HAS_XLCD
"MK4"
"MK3.5"
"iX"
"XL"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers(HAS_MMU2 "MK4" "MK3.5" "COREONE" "COREONEL")
set_feature_for_printers(HAS_CONFIG_STORE_WO_BACKEND "XL_DEV_KIT")
set_feature_for_printers_master_board(
HAS_CHAMBER_API "XL" "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX"
)
set_feature_for_printers_master_board(
HAS_CHAMBER_FILTRATION_API "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX" "XL"
)
set_feature_for_printers(HAS_CYPHAL_TIMESYNC "HONEYBEE_NEXT")
set_feature_for_printers_master_board(XL_ENCLOSURE_SUPPORT "XL")
set_feature_for_printers(HAS_SWITCHED_FAN_TEST "MK4" "MK3.5" "COREONE" "COREONEL")
set_feature_for_printers_master_board(
HAS_HOTEND_TYPE_SUPPORT
"MK4"
"MK3.5"
"iX"
"COREONE"
"COREONEL"
"XL"
)
set_feature_for_printers(HAS_EMERGENCY_STOP "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX")
set_feature_for_printers(HAS_15GT_BELTS "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX" "XL")
# The NTC and PT1000 ADC ranges overlap, so boot detection cannot tell them apart on a warm restart
if(DEVELOPMENT_ITEMS_ENABLED)
set_feature_for_printers(HAS_HT_HOTEND "COREONE" "COREONEL")
else()
set_feature_for_printers(HAS_HT_HOTEND)
endif()
set_feature_for_printers(HAS_EXPANSION_JOINTS_GEN_2 "COREONE" "COREONE_INDX")
set_feature_for_printers(HAS_CEILING_CLEARANCE "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX")
set_feature_for_printers(
HAS_CANCEL_OBJECT
"MK4"
"MK3.5"
"iX"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"XL"
"MINI"
)
set_feature_for_printers(
HAS_AUTO_RETRACT
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"MK4"
"iX"
"XL"
)
set_feature_for_printers(HAS_SWITCHABLE_AUTO_RETRACT "COREONE" "COREONEL" "MK4" "iX" "XL")
set_feature_for_printers(
HAS_FILAMENT_TRACKER
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"MK4"
"iX"
"XL"
) # TODO: When INDX gets fixed, also try enabling HAS_ANFC
set_feature_for_printers_master_board(
HAS_E2EE_SUPPORT
"MK4"
"MK3.5"
"iX"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"XL"
"UNITTESTS"
)
# Printers that support any form of backwards gcode compatibility modes XL: needed for XL-on-XLS
# compat mode (xl_compatibility_mode in M106 fan scaling)
set_feature_for_printers(HAS_GCODE_COMPATIBILITY "MK3.5" "MK4" "COREONE" "COREONEL" "XL")
# Checks for bed evenness during G29 and if it's too uneven, offers Z alignment calibration.
# Requires SELFTEST to work
set_feature_for_printers(HAS_UNEVEN_BED_PROMPT "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX")
set_feature_for_printers_master_board(HAS_TOOL_OFFSET_PIN_CALIBRATION "XL" "XL_DEV_KIT")
set_feature_for_printers(
HAS_DOOR_SENSOR_CALIBRATION "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX"
)
# Set GUI settings
set(PRINTERS_WITH_GUI
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"MINI"
"MK4"
"MK3.5"
"XL"
"iX"
)
set(PRINTERS_WITH_GUI_W480H320
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"MK4"
"MK3.5"
"XL"
"iX"
)
set(PRINTERS_WITH_GUI_W240H320 "MINI")
set_feature_for_printers(
HAS_LEDS
"MK4"
"MK3.5"
"XL"
"iX"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
# disable serial printing for MINI to save flash
set_feature_for_printers(
HAS_SERIAL_PRINT
"MK4"
"MK3.5"
"XL"
"iX"
"MINI"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
# Local accelerometer communicates directly over SPI
set_feature_for_printers(HAS_LOCAL_ACCELEROMETER "MK3.5" "MK4" "iX" "COREONE" "COREONEL")
# Remote accelerometer communicates indirectly over MODBUS
set_feature_for_printers(HAS_REMOTE_ACCELEROMETER "XL" "XL_DEV_KIT" "COREONE_INDX" "COREONEL_INDX")
# Some printers require manual mounting of accelerometer to the board, nozzle or bed
set_feature_for_printers(HAS_ATTACHABLE_ACCELEROMETER "MK3.5" "MK4" "COREONE")
set_feature_for_printers(HAS_COLDPULL "MK3.5" "MK4" "XL" "COREONE" "COREONEL")
set_feature_for_printers(HAS_BED_LEVEL_CORRECTION "MK3.5" "MINI")
set_feature_for_printers(HAS_SHEET_SUPPORT "MINI" "MK3.5")
set_feature_for_printers(
HAS_NFC
"MK3.5"
"MK4"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers(HAS_NOZZLE_CLEANER "iX" "COREONE_INDX" "COREONEL_INDX")
set_feature_for_printers(HAS_NOZZLE_CLEANER_LITE "XL" "COREONE" "COREONEL")
set_feature_for_printers(
HAS_MANUAL_BELT_TUNING "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX" "iX"
)
set_feature_for_printers_master_board(
HAS_I2C_EXPANDER
"MK3.5"
"MK4"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
)
set_feature_for_printers(HAS_WASTEBIN "iX" "COREONE_INDX" "COREONEL_INDX")
set_feature_for_printers_master_board(HAS_PRINT_FAN_TYPE "XL")
# CPU cooling fan on the XLBuddy sandwich board. Compiled in for all XL-family builds; actually
# started at runtime only on the XLS variant.
set_feature_for_printers_master_board(HAS_CPU_FAN "XL")
# GEARBOX_ALIGNMENT requires SELFTEST
set_feature_for_printers_master_board(HAS_GEARBOX_ALIGNMENT "MK4" "COREONE" "COREONEL" "XL")
set_feature_for_printers_master_board(
HAS_CHAMBER_VENTS "COREONE" "COREONE_INDX" "COREONEL" "COREONEL_INDX"
)
set_feature_for_printers_master_board(HAS_BED_FAN "COREONEL" "COREONEL_INDX")
set_feature_for_printers_master_board(HAS_PSU_FAN "COREONEL" "COREONEL_INDX")
set_feature_for_printers(HAS_AC_CONTROLLER "COREONEL" "COREONEL_INDX")
set_feature_for_printers(HAS_TOOL_OFFSET_SENSOR "COREONE_INDX" "COREONEL_INDX" "XL")
# Coil layout of the contactless tool-offset sensor: single-coil sweeps both axes over one coil,
# dual-coil (XLS) sweeps each axis over its own coil. An image only ever uses one of them, so only
# the matching measurement flow is compiled in.
if(NOT HAS_TOOL_OFFSET_SENSOR)
set(TOOL_OFFSET_SENSOR_GEOMETRY "NONE")
elseif(PRINTER STREQUAL "XL")
set(TOOL_OFFSET_SENSOR_GEOMETRY "DUAL_COIL")
else()
set(TOOL_OFFSET_SENSOR_GEOMETRY "SINGLE_COIL")
endif()
define_enum_option(
NAME TOOL_OFFSET_SENSOR_GEOMETRY VALUE "${TOOL_OFFSET_SENSOR_GEOMETRY}" ALL_VALUES
"NONE;SINGLE_COIL;DUAL_COIL"
)
# XL-CAN puppy. Compiled in for the XL family (shared xlBuddy master image); discovered at bootstrap
# and gated at runtime via XlCan::is_enabled(). Plain XL leaves it disabled (no bridge on the bus);
# XLS enables it when bootstrap finds the bridge on dock 9. Per the XLS HW spec every XLS has the
# bridge, so missing-bridge on XLS is a hardware fault rather than a normal config.
set_feature_for_printers_master_board(HAS_XL_CAN "XL")
if(DEVELOPMENT_ITEMS_ENABLED)
set_feature_for_printers(HAS_ANFC "COREONE" "COREONEL")
else()
set_feature_for_printers(HAS_ANFC)
endif()
set_feature_for_printers(HAS_HEATBED_SCREWS_DURING_TRANSPORT "COREONEL" "COREONEL_INDX")
# Use websocket to talk to Connect instead of many http requests.
#
# iX can't have websockets yet because of AFS version of Connect, all other printers should have it
# enabled.
#
# Eventually, this'll become the only used and supported way to talk to Connect. At that point, both
# this option and the "old" code will be removed.
set_feature_for_printers(
WEBSOCKET
"MINI"
"MK3.5"
"MK4"
"XL"
"COREONE"
"COREONE_INDX"
"COREONEL"
"COREONEL_INDX"
"XL_DEV_KIT"
)
set_feature_for_printers(HAS_INDX "COREONE_INDX" "COREONEL_INDX")
set_feature_for_printers(HAS_INDX_HEAD "COREONE_INDX" "COREONEL_INDX")
set_feature_for_printers(HAS_MOTOR_CURRENT_PROFILES "COREONE_INDX" "COREONEL_INDX")
# Wastebin fill-tracking (persistent pellet counter + pre-print / mid-print overfill warnings). Only
# INDX printers that actually have a wastebin (CoreOne / CoreOneL INDX).
if(HAS_WASTEBIN AND HAS_INDX)
define_boolean_option(HAS_WASTEBIN_FILL_TRACKING yes)
else()
define_boolean_option(HAS_WASTEBIN_FILL_TRACKING no)
endif()
if(HAS_TOOLCHANGER OR HAS_MMU2)
define_boolean_option(HAS_TOOL_MAPPING yes)
define_boolean_option(HAS_SPOOL_JOIN yes)
else()
define_boolean_option(HAS_TOOL_MAPPING no)
define_boolean_option(HAS_SPOOL_JOIN no)
endif()
if(HAS_TOOLCHANGER AND NOT HAS_INDX)
define_boolean_option(HAS_PER_TOOL_TEMPERATURES yes)
else()
define_boolean_option(HAS_PER_TOOL_TEMPERATURES no)
endif()
set_feature_for_printers(HAS_CYPHAL_METRICS)
set_feature_for_printers(HAS_CYPHAL_LOGGING)
# Set printer board
set(BOARDS_WITH_ADVANCED_POWER "XBUDDY" "XLBUDDY" "DWARF")
set(BOARDS_WITH_ILI9488 "XBUDDY" "XLBUDDY")
set(BOARDS_WITH_ST7789V "BUDDY")
set(BOARDS_WITH_ACCELEROMETER "XBUDDY" "DWARF")
set(BOARDS_WITH_USB_DEVICE "BUDDY" "XBUDDY" "XLBUDDY")
if(${TRANSLATIONS_ENABLED} STREQUAL "<default>")
if(${PRINTER} IN_LIST PRINTERS_WITH_TRANSLATIONS)
set(TRANSLATIONS_ENABLED YES)
else()
set(TRANSLATIONS_ENABLED NO)
endif()
endif()
define_boolean_option(HAS_TRANSLATIONS ${TRANSLATIONS_ENABLED})
# Set language options
set(LANGUAGES_AVAILABLE
CS
DE
ES
FR
IT
JA
PL
UK
)
if("${TRANSLATIONS_LIST}" STREQUAL "<default>")
if(PRINTER STREQUAL "MINI")
# Do not include translations to some build - Mini has explicitly listed translations
else()
# include all translations
foreach(LANG ${LANGUAGES_AVAILABLE})
define_boolean_option("ENABLE_TRANSLATION_${LANG}" yes)
endforeach()
endif()
else()
set(TRANSLATIONS_LIST_FOREACH ${TRANSLATIONS_LIST})
message(STATUS "Translation list: ${TRANSLATIONS_LIST}")
foreach(LANG ${TRANSLATIONS_LIST_FOREACH})
string(TOUPPER ${LANG} LANG)
define_boolean_option(ENABLE_TRANSLATION_${LANG} yes)
endforeach()
endif()
foreach(LANG ${LANGUAGES_AVAILABLE})
if(NOT DEFINED "ENABLE_TRANSLATION_${LANG}")
define_boolean_option("ENABLE_TRANSLATION_${LANG}" no)
endif()
endforeach()
if(${TOUCH_ENABLED} STREQUAL "<default>")
if(${PRINTER} MATCHES "^(iX)$")
set(TOUCH_ENABLED NO)
elseif((${BOARD} STREQUAL "XBUDDY") OR ${BOARD} STREQUAL "XLBUDDY")
set(TOUCH_ENABLED YES)
else()
set(TOUCH_ENABLED NO)
endif()
endif()
define_boolean_option(HAS_TOUCH ${TOUCH_ENABLED})
if(${PRINTER} IN_LIST PRINTERS_WITH_FILAMENT_SENSOR_BINARY AND BOARD_IS_MASTER_BOARD)
set(FILAMENT_SENSOR BINARY)
elseif(${PRINTER} IN_LIST PRINTERS_WITH_FILAMENT_SENSOR_ADC AND BOARD_IS_MASTER_BOARD)
set(FILAMENT_SENSOR ADC)
else()
set(FILAMENT_SENSOR NO)
endif()
define_enum_option(NAME FILAMENT_SENSOR VALUE "${FILAMENT_SENSOR}" ALL_VALUES "BINARY;ADC;NO")
if(FILAMENT_SENSOR STREQUAL "NO")
set(HAS_EXTRUDER_FSENSOR NO)
else()
set(HAS_EXTRUDER_FSENSOR YES)
endif()
define_boolean_option(HAS_EXTRUDER_FSENSOR ${HAS_EXTRUDER_FSENSOR})
if(${RESOURCES} STREQUAL "<auto>")
if(${PRINTER} IN_LIST PRINTERS_WITH_RESOURCES AND BOARD_IS_MASTER_BOARD)
set(RESOURCES "YES")
else()
set(RESOURCES "NO")
endif()
endif()
define_boolean_option(RESOURCES ${RESOURCES})
if(${PRINTER} IN_LIST PRINTERS_WITH_GUI AND BOARD_IS_MASTER_BOARD)
set(GUI YES)
if(${PRINTER} IN_LIST PRINTERS_WITH_GUI_W480H320 AND ${PRINTER} IN_LIST
PRINTERS_WITH_GUI_W240H320
)
message(FATAL_ERROR "Printer can only have one GUI resolution")
endif()
if(${PRINTER} IN_LIST PRINTERS_WITH_GUI_W480H320)
set(RESOLUTION W480H320)
elseif(${PRINTER} IN_LIST PRINTERS_WITH_GUI_W240H320)
set(RESOLUTION W240H320)
else()
message(FATAL_ERROR "Printer with GUI must have resolution set")
endif()
message(STATUS "RESOLUTION: ${RESOLUTION}")
else()
set(GUI NO)
endif()
message(STATUS "Graphical User Interface: ${GUI}")
define_boolean_option(HAS_GUI ${GUI})
if(BOARD_IS_MASTER_BOARD)
set(HAS_PLANNER true)
else()
set(HAS_PLANNER false)
endif()
define_boolean_option(HAS_PLANNER ${HAS_PLANNER})
if(ENABLE_BURST
AND ${PRINTER} IN_LIST PRINTERS_WITH_BURST_STEPPING
AND BOARD_IS_MASTER_BOARD
)
set(HAS_BURST_STEPPING YES)
else()
set(HAS_BURST_STEPPING NO)
endif()
define_boolean_option(HAS_BURST_STEPPING ${HAS_BURST_STEPPING})
if((${BOARD} STREQUAL "DWARF") OR (${BOARD} STREQUAL "XBUDDY" AND NOT (PRINTER STREQUAL "MK3.5"
OR HAS_INDX))
)
set(HAS_LOADCELL_HX717 YES)
else()
set(HAS_LOADCELL_HX717 NO)
endif()
define_boolean_option(HAS_LOADCELL_HX717 ${HAS_LOADCELL_HX717})
if(${BOARD} IN_LIST BOARDS_WITH_ADVANCED_POWER)
set(HAS_ADVANCED_POWER YES)
else()
set(HAS_ADVANCED_POWER NO)
endif()
define_boolean_option(HAS_ADVANCED_POWER ${HAS_ADVANCED_POWER})
if(${BOARD} IN_LIST BOARDS_WITH_ACCELEROMETER)