LIN_ADVANCE bug fix and optimization

.) long to int: Extruder stalls at 10kHz / 20kHz step limits with long.
.) Take the delta_adv_steps calculation out of the step_loops loop. Wasted calculation performance if done inside.
.) >> 2 replaced by 3: Is divide by 8. Reason: Timer 0 runs at 16/8=2MHz, Timer 1 at 16/64=0.25MHz. ==> 2/0.25=8.
This commit is contained in:
Sebastianv650
2016-10-08 18:13:04 +02:00
committed by Scott Lahteine
parent fc93796e42
commit a448cedbc5
2 changed files with 22 additions and 23 deletions

View File

@ -108,7 +108,7 @@ class Stepper {
static unsigned char old_OCR0A;
static volatile unsigned char eISR_Rate;
#if ENABLED(LIN_ADVANCE)
static volatile long e_steps[E_STEPPERS];
static volatile int e_steps[E_STEPPERS];
static int extruder_advance_k;
static int final_estep_rate;
static int current_estep_rate[E_STEPPERS]; // Actual extruder speed [steps/s]