Browse Source

Use right-shift instead of / 2, why not?

pull/1/head
Scott Lahteine 8 years ago
parent
commit
d80a79eb77
  1. 26
      Marlin/temperature.cpp

26
Marlin/temperature.cpp

@ -234,13 +234,13 @@ uint8_t Temperature::soft_pwm[HOTENDS];
#if HAS_PID_FOR_BOTH
if (hotend < 0)
soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2;
soft_pwm_bed = bias = d = (MAX_BED_POWER) >> 1;
else
soft_pwm[hotend] = bias = d = (PID_MAX) / 2;
soft_pwm[hotend] = bias = d = (PID_MAX) >> 1;
#elif ENABLED(PIDTEMP)
soft_pwm[hotend] = bias = d = (PID_MAX) / 2;
soft_pwm[hotend] = bias = d = (PID_MAX) >> 1;
#else
soft_pwm_bed = bias = d = (MAX_BED_POWER) / 2;
soft_pwm_bed = bias = d = (MAX_BED_POWER) >> 1;
#endif
wait_for_heatup = true;
@ -964,7 +964,7 @@ void Temperature::init() {
setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#if ENABLED(FAN_SOFT_PWM)
soft_pwm_fan[0] = fanSpeedSoftPwm[0] / 2;
soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
#endif
#endif
@ -974,7 +974,7 @@ void Temperature::init() {
setPwmFrequency(FAN1_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#if ENABLED(FAN_SOFT_PWM)
soft_pwm_fan[1] = fanSpeedSoftPwm[1] / 2;
soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
#endif
#endif
@ -984,7 +984,7 @@ void Temperature::init() {
setPwmFrequency(FAN2_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#if ENABLED(FAN_SOFT_PWM)
soft_pwm_fan[2] = fanSpeedSoftPwm[2] / 2;
soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
#endif
#endif
@ -1444,15 +1444,15 @@ void Temperature::isr() {
#if ENABLED(FAN_SOFT_PWM)
#if HAS_FAN0
soft_pwm_fan[0] = fanSpeedSoftPwm[0] / 2;
soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
#endif
#if HAS_FAN1
soft_pwm_fan[1] = fanSpeedSoftPwm[1] / 2;
soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
#endif
#if HAS_FAN2
soft_pwm_fan[2] = fanSpeedSoftPwm[2] / 2;
soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
#endif
#endif
@ -1563,15 +1563,15 @@ void Temperature::isr() {
#if ENABLED(FAN_SOFT_PWM)
if (pwm_count == 0) {
#if HAS_FAN0
soft_pwm_fan[0] = fanSpeedSoftPwm[0] / 2;
soft_pwm_fan[0] = fanSpeedSoftPwm[0] >> 1;
WRITE_FAN(soft_pwm_fan[0] > 0 ? 1 : 0);
#endif
#if HAS_FAN1
soft_pwm_fan[1] = fanSpeedSoftPwm[1] / 2;
soft_pwm_fan[1] = fanSpeedSoftPwm[1] >> 1;
WRITE_FAN1(soft_pwm_fan[1] > 0 ? 1 : 0);
#endif
#if HAS_FAN2
soft_pwm_fan[2] = fanSpeedSoftPwm[2] / 2;
soft_pwm_fan[2] = fanSpeedSoftPwm[2] >> 1;
WRITE_FAN2(soft_pwm_fan[2] > 0 ? 1 : 0);
#endif
}

Loading…
Cancel
Save