diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 363407e2..52444337 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -238,8 +238,8 @@ void get_coordinates(); void prepare_move(); void kill(const char *full_screen_message = NULL, unsigned char id = 0); void Stop(); - bool IsStopped(); +void finishAndDisableSteppers(); //put an ASCII command at the end of the current buffer. void enquecommand(const char *cmd, bool from_progmem = false); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index ea597c19..488639b9 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -4864,11 +4864,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) case_G80: { mesh_bed_leveling_flag = true; -#ifndef LA_NOCOMPAT - // When printing via USB there's no clear boundary between prints. Abuse MBL to indicate - // the beginning of a new print, allowing a new autodetected setting just after G80. - la10c_reset(); -#endif #ifndef PINDA_THERMISTOR static bool run = false; // thermistor-less PINDA temperature compensation is running #endif // ndef PINDA_THERMISTOR @@ -9698,6 +9693,24 @@ void Stop() bool IsStopped() { return Stopped; }; +void finishAndDisableSteppers() +{ + st_synchronize(); + disable_x(); + disable_y(); + disable_z(); + disable_e0(); + disable_e1(); + disable_e2(); + +#ifndef LA_NOCOMPAT + // Steppers are disabled both when a print is stopped and also via M84 (which is additionally + // checked-for to indicate a complete file), so abuse this function to reset the LA detection + // state for the next print. + la10c_reset(); +#endif +} + #ifdef FAST_PWM_FAN void setPwmFrequency(uint8_t pin, int val) { diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index 1b4c3b9a..de250ec9 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -1356,17 +1356,6 @@ float st_get_position_mm(uint8_t axis) } -void finishAndDisableSteppers() -{ - st_synchronize(); - disable_x(); - disable_y(); - disable_z(); - disable_e0(); - disable_e1(); - disable_e2(); -} - void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); diff --git a/Firmware/stepper.h b/Firmware/stepper.h index 7fdf426f..84773913 100644 --- a/Firmware/stepper.h +++ b/Firmware/stepper.h @@ -69,8 +69,6 @@ void invert_z_endstop(bool endstop_invert); void checkStepperErrors(); //Print errors detected by the stepper -void finishAndDisableSteppers(); - extern block_t *current_block; // A pointer to the block currently being traced extern bool x_min_endstop; extern bool x_max_endstop; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 275145d7..d8f3b16f 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -7340,9 +7340,6 @@ void lcd_print_stop() #ifdef MESH_BED_LEVELING mbl.active = false; //also prevents undoing the mbl compensation a second time in the second planner_abort_hard() #endif -#ifndef LA_NOCOMPAT - la10c_reset(); -#endif lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); stoptime = _millis();