Simplify power supply naming logic (#14488)
Co-Authored-By: Tim Moore <tim.moore@lightbend.com> Co-Authored-By: AnHardt <github@kitelab.de>
This commit is contained in:
committed by
Scott Lahteine
parent
44e4f853c8
commit
eb6dec03bd
@ -148,7 +148,7 @@
|
||||
#define LCD_CONTRAST_MAX 255
|
||||
#define DEFAULT_LCD_CONTRAST 220
|
||||
#define LED_COLORS_REDUCE_GREEN
|
||||
#if POWER_SUPPLY > 0 && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)
|
||||
#if (HAS_POWER_SWITCH && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1))
|
||||
#define LED_BACKLIGHT_TIMEOUT 10000
|
||||
#endif
|
||||
|
||||
|
@ -269,19 +269,22 @@
|
||||
#define DISABLE_INACTIVE_E DISABLE_E
|
||||
#endif
|
||||
|
||||
// Power Signal Control Definitions
|
||||
// By default use ATX definition
|
||||
#ifndef POWER_SUPPLY
|
||||
#define POWER_SUPPLY 1
|
||||
/**
|
||||
* Power Supply Control
|
||||
*/
|
||||
#ifndef PSU_NAME
|
||||
#if ENABLED(PSU_CONTROL)
|
||||
#if PSU_ACTIVE_HIGH
|
||||
#define PSU_NAME "XBox" // X-Box 360 (203W)
|
||||
#else
|
||||
#define PSU_NAME "ATX" // ATX style
|
||||
#endif
|
||||
#else
|
||||
#define PSU_NAME "Generic" // No control
|
||||
#endif
|
||||
#endif
|
||||
#if (POWER_SUPPLY == 1) // 1 = ATX
|
||||
#define PS_ON_AWAKE LOW
|
||||
#define PS_ON_ASLEEP HIGH
|
||||
#elif (POWER_SUPPLY == 2) // 2 = X-Box 360 203W
|
||||
#define PS_ON_AWAKE HIGH
|
||||
#define PS_ON_ASLEEP LOW
|
||||
#endif
|
||||
#define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
|
||||
|
||||
#define HAS_POWER_SWITCH (ENABLED(PSU_CONTROL) && PIN_EXISTS(PS_ON))
|
||||
|
||||
/**
|
||||
* Temp Sensor defines
|
||||
|
@ -376,6 +376,12 @@
|
||||
#error "USB_SD_DISABLED is now NO_SD_HOST_DRIVE. Please update your Configuration_adv.h."
|
||||
#elif defined(USB_SD_ONBOARD)
|
||||
#error "USB_SD_ONBOARD is obsolete. Disable NO_SD_HOST_DRIVE instead."
|
||||
#elif POWER_SUPPLY == 1
|
||||
#error "Replace POWER_SUPPLY 1 by enabling PSU_CONTROL and setting PSU_ACTIVE_HIGH to 'false'."
|
||||
#elif POWER_SUPPLY == 2
|
||||
#error "Replace POWER_SUPPLY 2 by enabling PSU_CONTROL and setting PSU_ACTIVE_HIGH to 'true'."
|
||||
#elif defined(POWER_SUPPLY)
|
||||
#error "POWER_SUPPLY is now obsolete. Please remove it from Configuration.h."
|
||||
#endif
|
||||
|
||||
#define BOARD_MKS_13 -47
|
||||
@ -1548,7 +1554,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
/**
|
||||
* LED Backlight Timeout
|
||||
*/
|
||||
#if defined(LED_BACKLIGHT_TIMEOUT) && !(EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && POWER_SUPPLY > 0)
|
||||
#if defined(LED_BACKLIGHT_TIMEOUT) && !(EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && HAS_POWER_SWITCH)
|
||||
#error "LED_BACKLIGHT_TIMEOUT requires a Fysetc Mini Panel and a Power Switch."
|
||||
#endif
|
||||
|
||||
@ -2297,6 +2303,13 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Ensure this option is set intentionally
|
||||
*/
|
||||
#if ENABLED(PSU_CONTROL) && !defined(PSU_ACTIVE_HIGH)
|
||||
#error "PSU_CONTROL requires PSU_ACTIVE_HIGH to be defined as 'true' or 'false'."
|
||||
#endif
|
||||
|
||||
#if HAS_CUTTER
|
||||
#define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
|
||||
#if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
|
||||
|
Reference in New Issue
Block a user