1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-29 09:10:03 +02:00

fix Spindle Issue 262

https://github.com/bdring/Grbl_Esp32/issues/252
This commit is contained in:
bdring
2019-10-15 17:54:59 -05:00
parent 515ce82672
commit 68ec92fa96

View File

@@ -106,16 +106,10 @@ void spindle_set_speed(uint32_t pwm_value)
#ifndef INVERT_SPINDLE_PWM
grbl_analogWrite(SPINDLE_PWM_CHANNEL, pwm_value);
#else
if (pwm_value == 0) {
grbl_analogWrite(SPINDLE_PWM_CHANNEL, (1<<SPINDLE_PWM_BIT_PRECISION));
}
else {
grbl_analogWrite(SPINDLE_PWM_CHANNEL, (1<<SPINDLE_PWM_BIT_PRECISION) - pwm_value - 1);
}
grbl_analogWrite(SPINDLE_PWM_CHANNEL, (1<<SPINDLE_PWM_BIT_PRECISION) - pwm_value);
#endif
#endif
}