Skip to content

Commit

Permalink
Merge branch 'Marlin_v1' into Creatr
Browse files Browse the repository at this point in the history
* Marlin_v1:
  Merge pull request MarlinFirmware#1 from illuminarti/Fix_E_Speed
  • Loading branch information
M. Adam Kendall committed Mar 17, 2013
2 parents c6742f2 + c856271 commit db9d420
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Marlin/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static long acceleration_time, deceleration_time;
static unsigned short acc_step_rate; // needed for deccelaration start point
static char step_loops;
static unsigned short OCR1A_nominal;
static unsigned short step_loops_nominal;

volatile long endstops_trigsteps[3]={0,0,0};
volatile long endstops_stepsTotal,endstops_stepsDone;
Expand Down Expand Up @@ -289,6 +290,8 @@ FORCE_INLINE void trapezoid_generator_reset() {
deceleration_time = 0;
// step_rate to timer interval
OCR1A_nominal = calc_timer(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);
OCR1A = acceleration_time;
Expand Down Expand Up @@ -704,6 +707,8 @@ ISR(TIMER1_COMPA_vect)
}
else {
OCR1A = OCR1A_nominal;
// ensure we're running at the correct step rate, even if we just came off an acceleration
step_loops = step_loops_nominal;
}

// If current block is finished, reset pointer
Expand Down

0 comments on commit db9d420

Please sign in to comment.