|
17 | 17 |
|
18 | 18 | CONTINUE_ON_ERROR = False |
19 | 19 |
|
20 | | -BOARDS = [ |
| 20 | +MKS_GENL_BOARDS = [ |
21 | 21 | "mksgenlv21", |
22 | 22 | "mksgenlv2", |
23 | 23 | "mksgenlv1", |
24 | | - "esp32", |
| 24 | +] |
| 25 | +AVR_BOARDS = MKS_GENL_BOARDS + [ |
25 | 26 | "ramps", |
26 | 27 | ] |
| 28 | +BOARDS = AVR_BOARDS + [ |
| 29 | + "esp32", |
| 30 | +] |
27 | 31 |
|
28 | 32 | STEPPER_TYPES = [ |
29 | 33 | "STEPPER_TYPE_NONE", |
|
47 | 51 | "DISPLAY_TYPE_LCD_JOY_I2C_SSD1306", |
48 | 52 | ] |
49 | 53 |
|
| 54 | +INFO_DISPLAY_TYPES = [ |
| 55 | + "INFO_DISPLAY_TYPE_NONE", |
| 56 | + "INFO_DISPLAY_TYPE_I2C_SSD1306_128x64", |
| 57 | +] |
| 58 | + |
50 | 59 | BUILD_FLAGS = { |
51 | 60 | "CONFIG_VERSION": "1", |
52 | 61 | "RA_STEPPER_TYPE": [x for x in STEPPER_TYPES if x != "STEPPER_TYPE_NONE"], |
|
62 | 71 | "FOCUS_STEPPER_TYPE": STEPPER_TYPES, |
63 | 72 | "FOCUS_DRIVER_TYPE": DRIVER_TYPES, |
64 | 73 | "DISPLAY_TYPE": DISPLAY_TYPES, |
| 74 | + "INFO_DISPLAY_TYPE": INFO_DISPLAY_TYPES, |
65 | 75 | "TEST_VERIFY_MODE": BOOLEAN_VALUES, |
66 | 76 | "DEBUG_LEVEL": ["DEBUG_NONE", "DEBUG_ANY"], |
67 | 77 | "RA_MOTOR_CURRENT_RATING": "1", |
@@ -236,6 +246,25 @@ def driver_supports_stepper(d, s): |
236 | 246 | problem.addConstraint(driver_supports_stepper, ["AZ_DRIVER_TYPE", "AZ_STEPPER_TYPE"]) |
237 | 247 | problem.addConstraint(driver_supports_stepper, ["FOCUS_DRIVER_TYPE", "FOCUS_STEPPER_TYPE"]) |
238 | 248 |
|
| 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 | + |
239 | 268 |
|
240 | 269 | # Define constraints for excluded tests |
241 | 270 | def set_test_constraints(problem): |
@@ -267,6 +296,14 @@ def set_ci_constraints(problem): |
267 | 296 | problem.addConstraint(InSetConstraint({"DISPLAY_TYPE_NONE", "DISPLAY_TYPE_LCD_KEYPAD"}), ["DISPLAY_TYPE"]) |
268 | 297 | # problem.addConstraint(InSetConstraint({"DRIVER_TYPE_ULN2003"}), ["ALT_DRIVER_TYPE"]) |
269 | 298 |
|
| 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 | + |
270 | 307 |
|
271 | 308 | def print_solutions_matrix(solutions, short_strings=False): |
272 | 309 | def get_value(vb, vk): |
|
0 commit comments