Skip to content

Commit

Permalink
Fix ui.external_control compile error (MarlinFirmware#18778)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv authored and albertogg committed Aug 31, 2020
1 parent f70bdc8 commit 97f917e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Marlin/src/lcd/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,19 +753,19 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
//SERIAL_ECHOLNPAIR("Post Move with Axis ", int(axis), " soon.");
}

#endif // HAS_LCD_MENU

#if ENABLED(AUTO_BED_LEVELING_UBL)
#if ENABLED(AUTO_BED_LEVELING_UBL)

void MarlinUI::external_encoder() {
if (external_control && encoderDiff) {
ubl.encoder_diff += encoderDiff; // Encoder for UBL G29 mesh editing
encoderDiff = 0; // Hide encoder events from the screen handler
refresh(LCDVIEW_REDRAW_NOW); // ...but keep the refresh.
void MarlinUI::external_encoder() {
if (external_control && encoderDiff) {
ubl.encoder_diff += encoderDiff; // Encoder for UBL G29 mesh editing
encoderDiff = 0; // Hide encoder events from the screen handler
refresh(LCDVIEW_REDRAW_NOW); // ...but keep the refresh.
}
}
}

#endif
#endif

#endif // HAS_LCD_MENU

/**
* Update the LCD, read encoder buttons, etc.
Expand Down Expand Up @@ -1283,7 +1283,9 @@ void MarlinUI::update() {
case encrot2: ENCODER_SPIN(encrot1, encrot3); break;
case encrot3: ENCODER_SPIN(encrot2, encrot0); break;
}
TERN_(AUTO_BED_LEVELING_UBL, external_encoder());
#if BOTH(HAS_LCD_MENU, AUTO_BED_LEVELING_UBL)
external_encoder();
#endif
lastEncoderBits = enc;
}

Expand Down

0 comments on commit 97f917e

Please sign in to comment.