Move reset LA state from G80 to M84
Move la10c_reset into finishAndDisableStepper, which is called in both via lcd_print_stop() and indirectly via M84, saving some space. M84 is checked-for to determine a complete file, so it's a superior candidate to G80 (which some people avoid due to MBL issues).
This commit is contained in:
parent
b9ce572559
commit
5082f2a36e
@ -238,8 +238,8 @@ void get_coordinates();
|
|||||||
void prepare_move();
|
void prepare_move();
|
||||||
void kill(const char *full_screen_message = NULL, unsigned char id = 0);
|
void kill(const char *full_screen_message = NULL, unsigned char id = 0);
|
||||||
void Stop();
|
void Stop();
|
||||||
|
|
||||||
bool IsStopped();
|
bool IsStopped();
|
||||||
|
void finishAndDisableSteppers();
|
||||||
|
|
||||||
//put an ASCII command at the end of the current buffer.
|
//put an ASCII command at the end of the current buffer.
|
||||||
void enquecommand(const char *cmd, bool from_progmem = false);
|
void enquecommand(const char *cmd, bool from_progmem = false);
|
||||||
|
@ -4864,11 +4864,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|||||||
case_G80:
|
case_G80:
|
||||||
{
|
{
|
||||||
mesh_bed_leveling_flag = true;
|
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
|
#ifndef PINDA_THERMISTOR
|
||||||
static bool run = false; // thermistor-less PINDA temperature compensation is running
|
static bool run = false; // thermistor-less PINDA temperature compensation is running
|
||||||
#endif // ndef PINDA_THERMISTOR
|
#endif // ndef PINDA_THERMISTOR
|
||||||
@ -9698,6 +9693,24 @@ void Stop()
|
|||||||
|
|
||||||
bool IsStopped() { return Stopped; };
|
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
|
#ifdef FAST_PWM_FAN
|
||||||
void setPwmFrequency(uint8_t pin, int val)
|
void setPwmFrequency(uint8_t pin, int val)
|
||||||
{
|
{
|
||||||
|
@ -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()
|
void quickStop()
|
||||||
{
|
{
|
||||||
DISABLE_STEPPER_DRIVER_INTERRUPT();
|
DISABLE_STEPPER_DRIVER_INTERRUPT();
|
||||||
|
@ -69,8 +69,6 @@ void invert_z_endstop(bool endstop_invert);
|
|||||||
|
|
||||||
void checkStepperErrors(); //Print errors detected by the stepper
|
void checkStepperErrors(); //Print errors detected by the stepper
|
||||||
|
|
||||||
void finishAndDisableSteppers();
|
|
||||||
|
|
||||||
extern block_t *current_block; // A pointer to the block currently being traced
|
extern block_t *current_block; // A pointer to the block currently being traced
|
||||||
extern bool x_min_endstop;
|
extern bool x_min_endstop;
|
||||||
extern bool x_max_endstop;
|
extern bool x_max_endstop;
|
||||||
|
@ -7340,9 +7340,6 @@ void lcd_print_stop()
|
|||||||
#ifdef MESH_BED_LEVELING
|
#ifdef MESH_BED_LEVELING
|
||||||
mbl.active = false; //also prevents undoing the mbl compensation a second time in the second planner_abort_hard()
|
mbl.active = false; //also prevents undoing the mbl compensation a second time in the second planner_abort_hard()
|
||||||
#endif
|
#endif
|
||||||
#ifndef LA_NOCOMPAT
|
|
||||||
la10c_reset();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lcd_setstatuspgm(_T(MSG_PRINT_ABORTED));
|
lcd_setstatuspgm(_T(MSG_PRINT_ABORTED));
|
||||||
stoptime = _millis();
|
stoptime = _millis();
|
||||||
|
Loading…
Reference in New Issue
Block a user