Reorg/cleanup

Removed unused progress variable
reorganized flow to avoid early returns (ensures forced high power mode is disabled regardless of outcome)
This commit is contained in:
vintagepc 2020-02-08 12:33:23 -05:00 committed by GitHub
parent 1384e783bf
commit 721b27fcb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 17 deletions

View File

@ -7453,7 +7453,6 @@ void lcd_belttest_print(const char* msg, uint16_t X, uint16_t Y)
} }
void lcd_belttest() void lcd_belttest()
{ {
int _progress = 0;
bool _result = true; bool _result = true;
#ifdef TMC2130 // Belttest requires high power mode. Enable it. #ifdef TMC2130 // Belttest requires high power mode. Enable it.
@ -7466,26 +7465,20 @@ void lcd_belttest()
_delay(2000); _delay(2000);
KEEPALIVE_STATE(IN_HANDLER); KEEPALIVE_STATE(IN_HANDLER);
_result = lcd_selfcheck_axis_sg(X_AXIS); _result = lcd_selfcheck_axis_sg(X_AXIS);
X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X));
if (!_result){ if (_result){
lcd_belttest_print(_i("Error"), X, Y); lcd_belttest_print(_i("Checking Y..."), X, Y);
return; _result = lcd_selfcheck_axis_sg(Y_AXIS);
Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
} }
lcd_belttest_print(_i("Checking Y..."), X, Y); if (!_result) {
_result = lcd_selfcheck_axis_sg(Y_AXIS);
Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
if (!_result){
lcd_belttest_print(_i("Error"), X, Y); lcd_belttest_print(_i("Error"), X, Y);
lcd_clear(); } else {
return; lcd_belttest_print(_i("Done"), X, Y);
} }
lcd_belttest_print(_i("Done"), X, Y);
#ifdef TMC2130 #ifdef TMC2130
FORCE_HIGH_POWER_END; FORCE_HIGH_POWER_END;