mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-01 18:32:37 +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:
@@ -195,7 +195,7 @@ const int stepTimerNumber = 0;
|
|||||||
hw_timer_t* stepTimer; // Handle
|
hw_timer_t* stepTimer; // Handle
|
||||||
// autoReload true might give better step timing - but it also
|
// autoReload true might give better step timing - but it also
|
||||||
// might cause problems if an interrupt takes too long
|
// might cause problems if an interrupt takes too long
|
||||||
bool autoReload = false;
|
const bool autoReload = true;
|
||||||
|
|
||||||
static void stepper_pulse_func();
|
static void stepper_pulse_func();
|
||||||
|
|
||||||
@@ -212,6 +212,7 @@ void IRAM_ATTR onStepperDriverTimer() {
|
|||||||
stepper_pulse_func();
|
stepper_pulse_func();
|
||||||
|
|
||||||
if (!autoReload) {
|
if (!autoReload) {
|
||||||
|
timerWrite(stepTimer, 0ULL);
|
||||||
timerAlarmEnable(stepTimer);
|
timerAlarmEnable(stepTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,8 +556,9 @@ void st_prep_buffer() {
|
|||||||
prep.current_speed = sqrt(pl_block->entry_speed_sqr);
|
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
|
// 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 (config->_laserMode) {
|
||||||
if (pl_block->spindle == SpindleState::Ccw) {
|
if (pl_block->spindle == SpindleState::Ccw) {
|
||||||
// Pre-compute inverse programmed rate to speed up PWM updating per step segment.
|
// Pre-compute inverse programmed rate to speed up PWM updating per step segment.
|
||||||
|
Reference in New Issue
Block a user