Misc formatting, cleanup

This commit is contained in:
Scott Lahteine 2020-07-18 18:54:44 -05:00
parent d579b70b7e
commit 0ddef5544a
3 changed files with 24 additions and 25 deletions

View file

@ -87,9 +87,8 @@ void StressTestScreen::runTestOnBootup(bool enable) {
} }
void StressTestScreen::startupCheck() { void StressTestScreen::startupCheck() {
if (LockScreen::get_hash() == 0xDEAD) { if (LockScreen::get_hash() == 0xDEAD)
GOTO_SCREEN(StressTestScreen); GOTO_SCREEN(StressTestScreen);
}
} }
void StressTestScreen::onEntry() { void StressTestScreen::onEntry() {
@ -120,20 +119,20 @@ void StressTestScreen::onIdle() {
reset_menu_timeout(); reset_menu_timeout();
if (!commandsInQueue()) { if (!commandsInQueue()) {
if (!isPositionKnown()) { if (!isPositionKnown()) {
extern const char G28_STR[]; extern const char G28_STR[];
injectCommands_P(G28_STR); injectCommands_P(G28_STR);
} }
else { else {
injectCommands_P(PSTR( injectCommands_P(PSTR(
"G0 X100 Y100 Z100 F6000\n" "G0 X100 Y100 Z100 F6000\n"
"T0\nG4 S1" "T0\nG4 S1"
#if EXTRUDERS > 1 #if EXTRUDERS > 1
"\nT1\nG4 S1" "\nT1\nG4 S1"
#endif #endif
"\nG0 X150 Y150 Z150" "\nG0 X150 Y150 Z150"
)); ));
} }
} }
if (refresh_timer.elapsed(STRESS_TEST_CHANGE_INTERVAL)) { if (refresh_timer.elapsed(STRESS_TEST_CHANGE_INTERVAL)) {
@ -141,10 +140,10 @@ void StressTestScreen::onIdle() {
} }
if (watchDogTestNow()) { if (watchDogTestNow()) {
if (random(2) % 2) if (random(2) % 2)
iterativeLockup(); iterativeLockup();
else else
recursiveLockup(); recursiveLockup();
} }
BaseScreen::onIdle(); BaseScreen::onIdle();

View file

@ -1524,17 +1524,17 @@ void MarlinUI::update() {
const int8_t xdir = col < (LCD_WIDTH ) / 2 ? -1 : 1, const int8_t xdir = col < (LCD_WIDTH ) / 2 ? -1 : 1,
ydir = row < (LCD_HEIGHT) / 2 ? -1 : 1; ydir = row < (LCD_HEIGHT) / 2 ? -1 : 1;
if (on_edit_screen) if (on_edit_screen)
encoderDiff = ENCODER_PULSES_PER_STEP * ydir; encoderDiff = (ENCODER_PULSES_PER_STEP) * ydir;
else if (screen_items > 0) { else if (screen_items > 0) {
// Last 3 cols act as a scroll :-) // Last 3 cols act as a scroll :-)
if (col > (LCD_WIDTH) - 5) if (col > (LCD_WIDTH) - 5)
// 2 * LCD_HEIGHT to scroll to bottom of next page. (LCD_HEIGHT would only go 1 item down.) // 2 * LCD_HEIGHT to scroll to bottom of next page. (LCD_HEIGHT would only go 1 item down.)
encoderDiff = ENCODER_PULSES_PER_STEP * (encoderLine - encoderTopLine + 2 * (LCD_HEIGHT)) * ydir; encoderDiff = (ENCODER_PULSES_PER_STEP) * (encoderLine - encoderTopLine + 2 * (LCD_HEIGHT)) * ydir;
else else
encoderDiff = ENCODER_PULSES_PER_STEP * (row - encoderPosition + encoderTopLine); encoderDiff = (ENCODER_PULSES_PER_STEP) * (row - encoderPosition + encoderTopLine);
} }
else if (!on_status_screen()) else if (!on_status_screen())
encoderDiff = ENCODER_PULSES_PER_STEP * xdir; encoderDiff = (ENCODER_PULSES_PER_STEP) * xdir;
} }
#endif #endif