|
@ -474,7 +474,10 @@ class Temperature { |
|
|
#define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT) |
|
|
#define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT) |
|
|
|
|
|
|
|
|
static void set_fan_speed(const uint8_t target, const uint16_t speed); |
|
|
static void set_fan_speed(const uint8_t target, const uint16_t speed); |
|
|
static void report_fan_speed(const uint8_t target); |
|
|
|
|
|
|
|
|
#if ENABLED(REPORT_FAN_CHANGE) |
|
|
|
|
|
static void report_fan_speed(const uint8_t target); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) |
|
|
#if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE) |
|
|
static bool fans_paused; |
|
|
static bool fans_paused; |
|
@ -487,13 +490,7 @@ class Temperature { |
|
|
|
|
|
|
|
|
static inline uint8_t scaledFanSpeed(const uint8_t target, const uint8_t fs) { |
|
|
static inline uint8_t scaledFanSpeed(const uint8_t target, const uint8_t fs) { |
|
|
UNUSED(target); // Potentially unused!
|
|
|
UNUSED(target); // Potentially unused!
|
|
|
return (fs * uint16_t( |
|
|
return (fs * uint16_t(TERN(ADAPTIVE_FAN_SLOWING, fan_speed_scaler[target], 128))) >> 7; |
|
|
#if ENABLED(ADAPTIVE_FAN_SLOWING) |
|
|
|
|
|
fan_speed_scaler[target] |
|
|
|
|
|
#else |
|
|
|
|
|
128 |
|
|
|
|
|
#endif |
|
|
|
|
|
)) >> 7; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static inline uint8_t scaledFanSpeed(const uint8_t target) { |
|
|
static inline uint8_t scaledFanSpeed(const uint8_t target) { |
|
@ -629,7 +626,7 @@ class Temperature { |
|
|
static void setTargetBed(const int16_t celsius) { |
|
|
static void setTargetBed(const int16_t celsius) { |
|
|
TERN_(AUTO_POWER_CONTROL, powerManager.power_on()); |
|
|
TERN_(AUTO_POWER_CONTROL, powerManager.power_on()); |
|
|
temp_bed.target = |
|
|
temp_bed.target = |
|
|
#ifdef BED_MAXTEMP |
|
|
#ifdef BED_MAX_TARGET |
|
|
_MIN(celsius, BED_MAX_TARGET) |
|
|
_MIN(celsius, BED_MAX_TARGET) |
|
|
#else |
|
|
#else |
|
|
celsius |
|
|
celsius |
|
@ -790,11 +787,7 @@ class Temperature { |
|
|
|
|
|
|
|
|
#define HAS_MAX6675 EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) |
|
|
#define HAS_MAX6675 EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) |
|
|
#if HAS_MAX6675 |
|
|
#if HAS_MAX6675 |
|
|
#if BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) |
|
|
#define COUNT_6675 1 + BOTH(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) |
|
|
#define COUNT_6675 2 |
|
|
|
|
|
#else |
|
|
|
|
|
#define COUNT_6675 1 |
|
|
|
|
|
#endif |
|
|
|
|
|
#if COUNT_6675 > 1 |
|
|
#if COUNT_6675 > 1 |
|
|
#define READ_MAX6675(N) read_max6675(N) |
|
|
#define READ_MAX6675(N) read_max6675(N) |
|
|
#else |
|
|
#else |
|
|