Merge pull request #2473 from vintagepc/#2472-#2356-belt-test-stealth-mode
#2472 #2356 #2484 belt test improvements
This commit is contained in:
commit
32fa7b5496
|
|
@ -7467,55 +7467,38 @@ static void lcd_belttest_v()
|
||||||
lcd_belttest();
|
lcd_belttest();
|
||||||
menu_back_if_clicked();
|
menu_back_if_clicked();
|
||||||
}
|
}
|
||||||
void lcd_belttest_print(const char* msg, uint16_t X, uint16_t Y)
|
|
||||||
{
|
|
||||||
lcd_clear();
|
|
||||||
lcd_printf_P(
|
|
||||||
_N(
|
|
||||||
"%S:\n"
|
|
||||||
"%S\n"
|
|
||||||
"X:%d\n"
|
|
||||||
"Y:%d"
|
|
||||||
),
|
|
||||||
_i("Belt status"),
|
|
||||||
msg,
|
|
||||||
X,Y
|
|
||||||
);
|
|
||||||
}
|
|
||||||
void lcd_belttest()
|
void lcd_belttest()
|
||||||
{
|
{
|
||||||
bool _result = true;
|
lcd_clear();
|
||||||
|
// Belttest requires high power mode. Enable it.
|
||||||
#ifdef TMC2130 // Belttest requires high power mode. Enable it.
|
FORCE_HIGH_POWER_START;
|
||||||
FORCE_HIGH_POWER_START;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X));
|
uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X));
|
||||||
uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
|
uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
|
||||||
lcd_belttest_print(_i("Checking X..."), X, Y);
|
lcd_printf_P(_i("Checking X axis ")); // share message with selftest
|
||||||
|
lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X);
|
||||||
KEEPALIVE_STATE(IN_HANDLER);
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
|
|
||||||
_result = lcd_selfcheck_axis_sg(X_AXIS);
|
// N.B: it doesn't make sense to handle !lcd_selfcheck...() because selftest_sg throws its own error screen
|
||||||
X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X));
|
// that clobbers ours, with more info than we could provide. So on fail we just fall through to take us back to status.
|
||||||
if (_result){
|
if (lcd_selfcheck_axis_sg(X_AXIS)){
|
||||||
lcd_belttest_print(_i("Checking Y..."), X, Y);
|
X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X));
|
||||||
_result = lcd_selfcheck_axis_sg(Y_AXIS);
|
lcd_set_cursor(10,1), lcd_printf_P(PSTR("%u"),X); // Show new X value next to old one.
|
||||||
Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
|
lcd_puts_at_P(0,2,_i("Checking Y axis "));
|
||||||
|
lcd_set_cursor(0,3), lcd_printf_P(PSTR("Y: %u -> ..."),Y);
|
||||||
|
if (lcd_selfcheck_axis_sg(Y_AXIS))
|
||||||
|
{
|
||||||
|
Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
|
||||||
|
lcd_set_cursor(10,3),lcd_printf_P(PSTR("%u"),Y);
|
||||||
|
lcd_set_cursor(19, 3);
|
||||||
|
lcd_print(LCD_STR_UPLEVEL);
|
||||||
|
lcd_wait_for_click_delay(10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_result) {
|
FORCE_HIGH_POWER_END;
|
||||||
lcd_belttest_print(_i("Error"), X, Y);
|
|
||||||
} else {
|
|
||||||
lcd_belttest_print(_i("Done"), X, Y);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef TMC2130
|
|
||||||
FORCE_HIGH_POWER_END;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
KEEPALIVE_STATE(NOT_BUSY);
|
KEEPALIVE_STATE(NOT_BUSY);
|
||||||
_delay(3000);
|
|
||||||
}
|
}
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
|
|
||||||
|
|
@ -7866,12 +7849,10 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
tmc2130_home_exit();
|
tmc2130_home_exit();
|
||||||
enable_endstops(true);
|
enable_endstops(true);
|
||||||
|
|
||||||
if (axis == X_AXIS) { //there is collision between cables and PSU cover in X axis if Z coordinate is too low
|
|
||||||
raise_z_above(17,true);
|
raise_z_above(MESH_HOME_Z_SEARCH);
|
||||||
tmc2130_home_enter(Z_AXIS_MASK);
|
st_synchronize();
|
||||||
st_synchronize();
|
tmc2130_home_enter(1 << axis);
|
||||||
tmc2130_home_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// first axis length measurement begin
|
// first axis length measurement begin
|
||||||
|
|
||||||
|
|
@ -7918,6 +7899,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
|
|
||||||
measured_axis_length[1] = abs(current_position_final - current_position_init);
|
measured_axis_length[1] = abs(current_position_final - current_position_init);
|
||||||
|
|
||||||
|
tmc2130_home_exit();
|
||||||
|
|
||||||
//end of second measurement, now check for possible errors:
|
//end of second measurement, now check for possible errors:
|
||||||
|
|
||||||
|
|
@ -7936,6 +7918,8 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
||||||
reset_crash_det(axis);
|
reset_crash_det(axis);
|
||||||
|
enable_endstops(true);
|
||||||
|
endstops_hit_on_purpose();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7954,12 +7938,13 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
||||||
reset_crash_det(axis);
|
reset_crash_det(axis);
|
||||||
|
endstops_hit_on_purpose();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
current_position[axis] = 0;
|
current_position[axis] = 0;
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
||||||
reset_crash_det(axis);
|
reset_crash_det(axis);
|
||||||
|
endstops_hit_on_purpose();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue