Browse Source

Fix PSU_POWERUP_DELAY compile error (#16064)

Felicia Hummel 5 years ago
parent
commit
6c2438deae
2 changed files with 13 additions and 16 deletions
  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 View File

321
 #endif
321
 #endif
322
 
322
 
323
 /**
323
 /**
324
- * Power Supply Control
324
+ * Power Supply
325
  */
325
  */
326
 #ifndef PSU_NAME
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
   #else
331
   #else
341
-    #define PSU_NAME "Generic"    // No control
332
+    #define PSU_NAME "ATX"      // ATX style
342
   #endif
333
   #endif
343
 #endif
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
  * Temp Sensor defines
341
  * Temp Sensor defines
347
  */
342
  */

+ 3
- 1
Marlin/src/inc/SanityCheck.h View File

1605
 /**
1605
 /**
1606
  * LED Backlight Timeout
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
   #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch."
1609
   #error "LED_BACKLIGHT_TIMEOUT requires a FYSETC Mini Panel and a Power Switch."
1610
 #endif
1610
 #endif
1611
 
1611
 
2486
     #error "PSU_CONTROL requires PSU_ACTIVE_HIGH to be defined as 'true' or 'false'."
2486
     #error "PSU_CONTROL requires PSU_ACTIVE_HIGH to be defined as 'true' or 'false'."
2487
   #elif !PIN_EXISTS(PS_ON)
2487
   #elif !PIN_EXISTS(PS_ON)
2488
     #error "PSU_CONTROL requires PS_ON_PIN."
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
   #endif
2491
   #endif
2490
 #elif ENABLED(AUTO_POWER_CONTROL)
2492
 #elif ENABLED(AUTO_POWER_CONTROL)
2491
   #error "AUTO_POWER_CONTROL requires PSU_CONTROL."
2493
   #error "AUTO_POWER_CONTROL requires PSU_CONTROL."

Loading…
Cancel
Save