Skip to content

Commit c26ce6e

Browse files
Add INFO_DISPLAY_TYPES to matrix_build.py
1 parent 3550d53 commit c26ce6e

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

matrix_build.py

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@
1717

1818
CONTINUE_ON_ERROR = False
1919

20-
BOARDS = [
20+
MKS_GENL_BOARDS = [
2121
"mksgenlv21",
2222
"mksgenlv2",
2323
"mksgenlv1",
24-
"esp32",
24+
]
25+
AVR_BOARDS = MKS_GENL_BOARDS + [
2526
"ramps",
2627
]
28+
BOARDS = AVR_BOARDS + [
29+
"esp32",
30+
]
2731

2832
STEPPER_TYPES = [
2933
"STEPPER_TYPE_NONE",
@@ -47,6 +51,11 @@
4751
"DISPLAY_TYPE_LCD_JOY_I2C_SSD1306",
4852
]
4953

54+
INFO_DISPLAY_TYPES = [
55+
"INFO_DISPLAY_TYPE_NONE",
56+
"INFO_DISPLAY_TYPE_I2C_SSD1306_128x64",
57+
]
58+
5059
BUILD_FLAGS = {
5160
"CONFIG_VERSION": "1",
5261
"RA_STEPPER_TYPE": [x for x in STEPPER_TYPES if x != "STEPPER_TYPE_NONE"],
@@ -62,6 +71,7 @@
6271
"FOCUS_STEPPER_TYPE": STEPPER_TYPES,
6372
"FOCUS_DRIVER_TYPE": DRIVER_TYPES,
6473
"DISPLAY_TYPE": DISPLAY_TYPES,
74+
"INFO_DISPLAY_TYPE": INFO_DISPLAY_TYPES,
6575
"TEST_VERIFY_MODE": BOOLEAN_VALUES,
6676
"DEBUG_LEVEL": ["DEBUG_NONE", "DEBUG_ANY"],
6777
"RA_MOTOR_CURRENT_RATING": "1",
@@ -236,6 +246,25 @@ def driver_supports_stepper(d, s):
236246
problem.addConstraint(driver_supports_stepper, ["AZ_DRIVER_TYPE", "AZ_STEPPER_TYPE"])
237247
problem.addConstraint(driver_supports_stepper, ["FOCUS_DRIVER_TYPE", "FOCUS_STEPPER_TYPE"])
238248

249+
# AVR boards can't have both DISPLAY_TYPE and INFO_DISPLAY_TYPE enabled
250+
def avr_display_exclusivity(board, display, info_display):
251+
if board not in AVR_BOARDS:
252+
return True
253+
return (
254+
display == "DISPLAY_TYPE_NONE" or
255+
info_display == "INFO_DISPLAY_TYPE_NONE"
256+
)
257+
problem.addConstraint(avr_display_exclusivity, ["BOARD", "DISPLAY_TYPE", "INFO_DISPLAY_TYPE"])
258+
259+
# MKS GenL boards must not have a focus stepper when info display is enabled
260+
def mksgenl_focus_exclusivity(board, info_display, focus_stepper):
261+
if board not in MKS_GENL_BOARDS:
262+
return True
263+
if info_display != "INFO_DISPLAY_TYPE_NONE":
264+
return focus_stepper == "STEPPER_TYPE_NONE"
265+
return True
266+
problem.addConstraint(mksgenl_focus_exclusivity, ["BOARD", "INFO_DISPLAY_TYPE", "FOCUS_STEPPER_TYPE"])
267+
239268

240269
# Define constraints for excluded tests
241270
def set_test_constraints(problem):
@@ -267,6 +296,14 @@ def set_ci_constraints(problem):
267296
problem.addConstraint(InSetConstraint({"DISPLAY_TYPE_NONE", "DISPLAY_TYPE_LCD_KEYPAD"}), ["DISPLAY_TYPE"])
268297
# problem.addConstraint(InSetConstraint({"DRIVER_TYPE_ULN2003"}), ["ALT_DRIVER_TYPE"])
269298

299+
# Restrict INFO_DISPLAY_TYPE_I2C_SSD1306_128x64 to mksgenlv21 and esp32 only
300+
# (just to reduce compile times)
301+
def info_display_constraint(board, info_display):
302+
if info_display == "INFO_DISPLAY_TYPE_I2C_SSD1306_128x64":
303+
return board in ["mksgenlv21", "esp32"]
304+
return True
305+
problem.addConstraint(info_display_constraint, ["BOARD", "INFO_DISPLAY_TYPE"])
306+
270307

271308
def print_solutions_matrix(solutions, short_strings=False):
272309
def get_value(vb, vk):

0 commit comments

Comments
 (0)