Common method for scaled fan speed

This commit is contained in:
Scott Lahteine
2019-06-28 13:58:40 -05:00
parent 1a09c4dea5
commit a8d68b7c8a
7 changed files with 16 additions and 9 deletions

View File

@ -472,8 +472,12 @@ class Temperature {
static constexpr uint8_t fan_speed_scaler[FAN_COUNT] = ARRAY_N(FAN_COUNT, 128, 128, 128, 128, 128, 128);
#endif
static inline uint8_t lcd_fanSpeedActual(const uint8_t target) {
return (fan_speed[target] * uint16_t(fan_speed_scaler[target])) >> 7;
static inline uint8_t scaledFanSpeed(const uint8_t target) {
return (fs * uint16_t(fan_speed_scaler[target])) >> 7;
}
static inline uint8_t scaledFanSpeed(const uint8_t target, const uint8_t fs) {
return scaledFanSpeed(target, fan_speed[target]);
}
#if ENABLED(EXTRA_FAN_SPEED)