Add a limit to how many times G80 can fail
Flash: +80 SRAM: +1
This commit is contained in:
parent
7740a81edb
commit
f5f09f147c
|
|
@ -2970,7 +2970,11 @@ static void gcode_G80()
|
||||||
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
||||||
plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
static uint8_t g80_fail_cnt = 0;
|
||||||
if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) {
|
if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) {
|
||||||
|
if (g80_fail_cnt++ >= 2) {
|
||||||
|
kill(_i("Mesh bed leveling failed. Please run Z calibration"));
|
||||||
|
}
|
||||||
Sound_MakeSound(e_SOUND_TYPE_StandardAlert);
|
Sound_MakeSound(e_SOUND_TYPE_StandardAlert);
|
||||||
bool bState;
|
bool bState;
|
||||||
do { // repeat until Z-leveling o.k.
|
do { // repeat until Z-leveling o.k.
|
||||||
|
|
@ -3005,6 +3009,8 @@ static void gcode_G80()
|
||||||
repeatcommand_front(); // re-run (i.e. of "G80")
|
repeatcommand_front(); // re-run (i.e. of "G80")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
g80_fail_cnt = 0; // no fail was detected. Reset the error counter.
|
||||||
|
|
||||||
clean_up_after_endstop_move(l_feedmultiply);
|
clean_up_after_endstop_move(l_feedmultiply);
|
||||||
|
|
||||||
#ifndef PINDA_THERMISTOR
|
#ifndef PINDA_THERMISTOR
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue