1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-31 10:01:48 +02:00

Fixed stepping hang problem

The timer reload code was missing a clear of the timer register.
Also switched to autoreload; either change fixes the problem.
This commit is contained in:
Mitch Bradley
2021-06-23 12:29:13 -10:00
parent 07499e254b
commit f46015247e

View File

@@ -195,7 +195,7 @@ const int stepTimerNumber = 0;
hw_timer_t* stepTimer; // Handle
// autoReload true might give better step timing - but it also
// might cause problems if an interrupt takes too long
bool autoReload = false;
const bool autoReload = true;
static void stepper_pulse_func();
@@ -212,6 +212,7 @@ void IRAM_ATTR onStepperDriverTimer() {
stepper_pulse_func();
if (!autoReload) {
timerWrite(stepTimer, 0ULL);
timerAlarmEnable(stepTimer);
}
@@ -555,8 +556,9 @@ void st_prep_buffer() {
prep.current_speed = sqrt(pl_block->entry_speed_sqr);
}
st_prep_block->is_pwm_rate_adjusted = false; // set default value
// prep.inv_rate is only used if is_pwm_rate_adjusted is true
st_prep_block->is_pwm_rate_adjusted = false; // set default value
if (config->_laserMode) {
if (pl_block->spindle == SpindleState::Ccw) {
// Pre-compute inverse programmed rate to speed up PWM updating per step segment.