Use "& 0x3F" instead of "% 64"
This commit is contained in:
parent
6a040a6967
commit
043be2856b
1 changed files with 4 additions and 4 deletions
|
@ -1743,9 +1743,9 @@ void Temperature::isr() {
|
||||||
|
|
||||||
// increment slow_pwm_count only every 64th pwm_count,
|
// increment slow_pwm_count only every 64th pwm_count,
|
||||||
// i.e. yielding a PWM frequency of 16/128 Hz (8s).
|
// i.e. yielding a PWM frequency of 16/128 Hz (8s).
|
||||||
if (((pwm_count >> SOFT_PWM_SCALE) % 64) == 0) {
|
if (((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0) {
|
||||||
slow_pwm_count++;
|
slow_pwm_count++;
|
||||||
slow_pwm_count &= 0x7f;
|
slow_pwm_count &= 0x7F;
|
||||||
|
|
||||||
// EXTRUDER 0
|
// EXTRUDER 0
|
||||||
if (state_timer_heater_0 > 0) state_timer_heater_0--;
|
if (state_timer_heater_0 > 0) state_timer_heater_0--;
|
||||||
|
@ -1761,7 +1761,7 @@ void Temperature::isr() {
|
||||||
#if HAS_HEATER_BED
|
#if HAS_HEATER_BED
|
||||||
if (state_timer_heater_BED > 0) state_timer_heater_BED--;
|
if (state_timer_heater_BED > 0) state_timer_heater_BED--;
|
||||||
#endif
|
#endif
|
||||||
} // (pwm_count % 64) == 0
|
} // ((pwm_count >> SOFT_PWM_SCALE) & 0x3F) == 0
|
||||||
|
|
||||||
#endif // SLOW_PWM_HEATERS
|
#endif // SLOW_PWM_HEATERS
|
||||||
|
|
||||||
|
|
Reference in a new issue