Apply TERN to compact code (#17619)
This commit is contained in:
@@ -50,15 +50,12 @@ bool Power::is_power_needed() {
|
||||
if (controllerFan.state()) return true;
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_POWER_CHAMBER_FAN)
|
||||
if (thermalManager.chamberfan_speed) return true;
|
||||
#endif
|
||||
if (TERN0(AUTO_POWER_CHAMBER_FAN, thermalManager.chamberfan_speed))
|
||||
return true;
|
||||
|
||||
// If any of the drivers or the bed are enabled...
|
||||
if (X_ENABLE_READ() == X_ENABLE_ON || Y_ENABLE_READ() == Y_ENABLE_ON || Z_ENABLE_READ() == Z_ENABLE_ON
|
||||
#if HAS_HEATED_BED
|
||||
|| thermalManager.temp_bed.soft_pwm_amount > 0
|
||||
#endif
|
||||
|| TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0)
|
||||
#if HAS_X2_ENABLE
|
||||
|| X2_ENABLE_READ() == X_ENABLE_ON
|
||||
#endif
|
||||
@@ -75,10 +72,7 @@ bool Power::is_power_needed() {
|
||||
) return true;
|
||||
|
||||
HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true;
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
if (thermalManager.degTargetBed() > 0) return true;
|
||||
#endif
|
||||
if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) return true;
|
||||
|
||||
#if HOTENDS && AUTO_POWER_E_TEMP
|
||||
HOTEND_LOOP() if (thermalManager.degHotend(e) >= AUTO_POWER_E_TEMP) return true;
|
||||
|
||||
Reference in New Issue
Block a user