Skip to content

Commit

Permalink
🐛 Followup to JyersUI
Browse files Browse the repository at this point in the history
Fix #22736
  • Loading branch information
thinkyhead committed Sep 11, 2021
1 parent 953d283 commit ecae5ba
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Marlin/src/lcd/e3v2/creality/rotary_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#if ENCODER_5X_STEPS_PER_SEC
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#endif
}
EncoderRate.lastEncoderTime = ms;
}
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/lcd/e3v2/enhanced/rotary_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#if ENCODER_5X_STEPS_PER_SEC
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#endif
}
EncoderRate.lastEncoderTime = ms;
}
Expand Down
14 changes: 8 additions & 6 deletions Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4757,11 +4757,13 @@ void CrealityDWINClass::Start_Print(bool sd) {
printing = true;
statusmsg[0] = '\0';
if (sd) {
if (recovery.valid()) {
SdFile *diveDir = nullptr;
const char * const fname = card.diveToFile(true, diveDir, recovery.info.sd_filename);
card.selectFileByName(fname);
}
#if ENABLED(POWER_LOSS_RECOVERY)
if (recovery.valid()) {
SdFile *diveDir = nullptr;
const char * const fname = card.diveToFile(true, diveDir, recovery.info.sd_filename);
card.selectFileByName(fname);
}
#endif
strcpy_P(filename, card.longest_filename());
}
else
Expand Down Expand Up @@ -4801,7 +4803,7 @@ void MarlinUI::update() { CrealityDWIN.Update(); }

void CrealityDWINClass::State_Update() {
if ((print_job_timer.isRunning() || print_job_timer.isPaused()) != printing) {
if (!printing) Start_Print((card.isFileOpen() || recovery.valid()));
if (!printing) Start_Print(card.isFileOpen() || TERN0(POWER_LOSS_RECOVERY, recovery.valid()));
else Stop_Print();
}
if (print_job_timer.isPaused() != paused) {
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/lcd/e3v2/jyersui/rotary_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#if ENCODER_5X_STEPS_PER_SEC
else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
#endif
}
EncoderRate.lastEncoderTime = ms;
}
Expand Down

0 comments on commit ecae5ba

Please sign in to comment.