TCNT0 => HAL_timer_get_current_count

Fix #8710
This commit is contained in:
Scott Lahteine
2017-12-08 22:13:03 -06:00
parent b3daf6b5db
commit 4fa65a5c25
3 changed files with 26 additions and 25 deletions

View File

@ -278,7 +278,7 @@ class Stepper {
private:
FORCE_INLINE static hal_timer_t calc_timer(hal_timer_t step_rate) {
FORCE_INLINE static hal_timer_t calc_timer_interval(hal_timer_t step_rate) {
hal_timer_t timer;
NOMORE(step_rate, MAX_STEP_FREQUENCY);
@ -359,11 +359,11 @@ class Stepper {
deceleration_time = 0;
// step_rate to timer interval
OCR1A_nominal = calc_timer(current_block->nominal_rate);
OCR1A_nominal = calc_timer_interval(current_block->nominal_rate);
// make a note of the number of step loops required at nominal speed
step_loops_nominal = step_loops;
acc_step_rate = current_block->initial_rate;
acceleration_time = calc_timer(acc_step_rate);
acceleration_time = calc_timer_interval(acc_step_rate);
_NEXT_ISR(acceleration_time);
#if ENABLED(LIN_ADVANCE)