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

@ -35,7 +35,7 @@
#define CHOPPER_DEFAULT_36V { 5, 2, 4 }
#define CHOPPER_PRUSAMK3_24V { 3, -2, 6 }
#define CHOPPER_MARLIN_119 { 5, 2, 3 }
#define CHOPPER_09STEP_24V { 3, -1, 5 }
#define CHOPPER_09STEP_24V { 3, -1, 5 }
#if ENABLED(MONITOR_DRIVER_STATUS) && !defined(MONITOR_DRIVER_STATUS_INTERVAL_MS)
#define MONITOR_DRIVER_STATUS_INTERVAL_MS 500u

View File

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

View File

@ -1524,17 +1524,17 @@ void MarlinUI::update() {
const int8_t xdir = col < (LCD_WIDTH ) / 2 ? -1 : 1,
ydir = row < (LCD_HEIGHT) / 2 ? -1 : 1;
if (on_edit_screen)
encoderDiff = ENCODER_PULSES_PER_STEP * ydir;
encoderDiff = (ENCODER_PULSES_PER_STEP) * ydir;
else if (screen_items > 0) {
// Last 3 cols act as a scroll :-)
if (col > (LCD_WIDTH) - 5)
// 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
encoderDiff = ENCODER_PULSES_PER_STEP * (row - encoderPosition + encoderTopLine);
encoderDiff = (ENCODER_PULSES_PER_STEP) * (row - encoderPosition + encoderTopLine);
}
else if (!on_status_screen())
encoderDiff = ENCODER_PULSES_PER_STEP * xdir;
encoderDiff = (ENCODER_PULSES_PER_STEP) * xdir;
}
#endif