瀏覽代碼

Fix PSU_POWERUP_DELAY compile error (#16064)

Felicia Hummel 5 年之前
父節點
當前提交
6c2438deae
共有 2 個檔案被更改,包括 13 行新增16 行删除
  1. 10
    15
      Marlin/src/inc/Conditionals_post.h
  2. 3
    1
      Marlin/src/inc/SanityCheck.h

+ 10
- 15
Marlin/src/inc/Conditionals_post.h 查看文件

@@ -321,27 +321,22 @@
321 321
 #endif
322 322
 
323 323
 /**
324
- * Power Supply Control
324
+ * Power Supply
325 325
  */
326 326
 #ifndef PSU_NAME
327
-  #if ENABLED(PSU_CONTROL)
328
-    #if PSU_ACTIVE_HIGH
329
-      #define PSU_NAME "XBox"     // X-Box 360 (203W)
330
-    #else
331
-      #define PSU_NAME "ATX"      // ATX style
332
-    #endif
333
-    #if DISABLED(AUTO_POWER_CONTROL)
334
-      #ifndef PSU_POWERUP_DELAY
335
-        #define PSU_POWERUP_DELAY 100
336
-      #endif
337
-    #elif defined(PSU_POWERUP_DELAY)
338
-      #error "PSU_POWERUP_DELAY has no effect if AUTO_POWER_CONTROL is enabled."
339
-    #endif
327
+  #if DISABLED(PSU_CONTROL)
328
+    #define PSU_NAME "Generic"  // No control
329
+  #elif PSU_ACTIVE_HIGH
330
+    #define PSU_NAME "XBox"     // X-Box 360 (203W)
340 331
   #else
341
-    #define PSU_NAME "Generic"    // No control
332
+    #define PSU_NAME "ATX"      // ATX style
342 333
   #endif
343 334
 #endif
344 335
 
336
+#if !defined(PSU_POWERUP_DELAY) && ENABLED(PSU_CONTROL) && DISABLED(AUTO_POWER_CONTROL)
337
+  #define PSU_POWERUP_DELAY 100
338
+#endif
339
+
345 340
 /**
346 341
  * Temp Sensor defines
347 342
  */

+ 3
- 1
Marlin/src/inc/SanityCheck.h 查看文件

@@ -1605,7 +1605,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1605 1605
 /**
1606 1606
  * LED Backlight Timeout
1607 1607
  */
1608
-#if defined(LED_BACKLIGHT_TIMEOUT) && !(EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && ENABLED(PSU_CONTROL))
1608
+#if defined(LED_BACKLIGHT_TIMEOUT) && !(ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1))
1609 1609
   #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch."
1610 1610
 #endif
1611 1611
 
@@ -2486,6 +2486,8 @@ static_assert(   _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
2486 2486
     #error "PSU_CONTROL requires PSU_ACTIVE_HIGH to be defined as 'true' or 'false'."
2487 2487
   #elif !PIN_EXISTS(PS_ON)
2488 2488
     #error "PSU_CONTROL requires PS_ON_PIN."
2489
+  #elif defined(PSU_POWERUP_DELAY) && ENABLED(AUTO_POWER_CONTROL)
2490
+    #error "PSU_POWERUP_DELAY has no effect with AUTO_POWER_CONTROL enabled."
2489 2491
   #endif
2490 2492
 #elif ENABLED(AUTO_POWER_CONTROL)
2491 2493
   #error "AUTO_POWER_CONTROL requires PSU_CONTROL."

Loading…
取消
儲存