Merge pull request #83 from PavelSindler/lin_adv_fix

Lin adv. fix from MK2 fw
This commit is contained in:
PavelSindler 2017-11-15 11:53:39 +01:00 committed by GitHub
commit 19d89b37b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -5640,6 +5640,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
else if(code_seen('T')) else if(code_seen('T'))
{ {
int index; int index;
st_synchronize();
for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++);
if ((*(strchr_pointer + index) < '0' || *(strchr_pointer + index) > '9') && *(strchr_pointer + index) != '?') { if ((*(strchr_pointer + index) < '0' || *(strchr_pointer + index) > '9') && *(strchr_pointer + index) != '?') {
@ -5662,7 +5663,7 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
snmm_extruder = tmp_extruder; snmm_extruder = tmp_extruder;
st_synchronize();
delay(100); delay(100);
disable_e0(); disable_e0();

View File

@ -1292,12 +1292,18 @@ void plan_set_position(float x, float y, float z, const float &e)
// Only useful in the bed leveling routine, when the mesh bed leveling is off. // Only useful in the bed leveling routine, when the mesh bed leveling is off.
void plan_set_z_position(const float &z) void plan_set_z_position(const float &z)
{ {
#ifdef LIN_ADVANCE
position_float[Z_AXIS] = z;
#endif
position[Z_AXIS] = lround(z*axis_steps_per_unit[Z_AXIS]); position[Z_AXIS] = lround(z*axis_steps_per_unit[Z_AXIS]);
st_set_position(position[X_AXIS], position[Y_AXIS], position[Z_AXIS], position[E_AXIS]); st_set_position(position[X_AXIS], position[Y_AXIS], position[Z_AXIS], position[E_AXIS]);
} }
void plan_set_e_position(const float &e) void plan_set_e_position(const float &e)
{ {
#ifdef LIN_ADVANCE
position_float[E_AXIS] = e;
#endif
position[E_AXIS] = lround(e*axis_steps_per_unit[E_AXIS]); position[E_AXIS] = lround(e*axis_steps_per_unit[E_AXIS]);
st_set_e_position(position[E_AXIS]); st_set_e_position(position[E_AXIS]);
} }

View File

@ -846,9 +846,6 @@ void isr() {
// Timer interrupt for E. e_steps is set in the main routine. // Timer interrupt for E. e_steps is set in the main routine.
void advance_isr() { void advance_isr() {
nextAdvanceISR = eISR_Rate;
if (e_steps) { if (e_steps) {
bool dir = bool dir =
#ifdef SNMM #ifdef SNMM
@ -869,6 +866,10 @@ void advance_isr() {
} }
} }
else {
eISR_Rate = ADV_NEVER;
}
nextAdvanceISR = eISR_Rate;
} }
void advance_isr_scheduler() { void advance_isr_scheduler() {