|
@@ -130,7 +130,6 @@ void MenuItem_gcode::action(PGM_P const pgcode) { queue.inject_P(pgcode); }
|
130
|
130
|
* MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
|
131
|
131
|
*/
|
132
|
132
|
void MenuItemBase::edit(strfunc_t strfunc, loadfunc_t loadfunc) {
|
133
|
|
- ui.encoder_direction_normal();
|
134
|
133
|
if (int16_t(ui.encoderPosition) < 0) ui.encoderPosition = 0;
|
135
|
134
|
if (int16_t(ui.encoderPosition) > maxEditValue) ui.encoderPosition = maxEditValue;
|
136
|
135
|
if (ui.should_draw())
|
|
@@ -276,7 +275,11 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
|
276
|
275
|
drawing_screen = false;
|
277
|
276
|
#endif
|
278
|
277
|
|
279
|
|
- set_ui_selection(false);
|
|
278
|
+ #if HAS_LCD_MENU
|
|
279
|
+ encoder_direction_normal();
|
|
280
|
+ #endif
|
|
281
|
+
|
|
282
|
+ set_selection(false);
|
280
|
283
|
}
|
281
|
284
|
}
|
282
|
285
|
|
|
@@ -371,7 +374,6 @@ void MarlinUI::completion_feedback(const bool good/*=true*/) {
|
371
|
374
|
#else
|
372
|
375
|
constexpr bool do_probe = true;
|
373
|
376
|
#endif
|
374
|
|
- ui.encoder_direction_normal();
|
375
|
377
|
if (ui.encoderPosition) {
|
376
|
378
|
const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR);
|
377
|
379
|
ui.encoderPosition = 0;
|
|
@@ -448,14 +450,16 @@ void _lcd_draw_homing() {
|
448
|
450
|
//
|
449
|
451
|
// Selection screen presents a prompt and two options
|
450
|
452
|
//
|
451
|
|
-bool ui_selection; // = false
|
452
|
|
-void set_ui_selection(const bool sel) { ui_selection = sel; }
|
453
|
|
-void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) {
|
454
|
|
- if (ui.encoderPosition) {
|
455
|
|
- ui_selection = ((ENCODERBASE) > 0) == (int16_t(ui.encoderPosition) > 0);
|
456
|
|
- ui.encoderPosition = 0;
|
|
453
|
+bool MarlinUI::selection; // = false
|
|
454
|
+bool MarlinUI::update_selection() {
|
|
455
|
+ if (encoderPosition) {
|
|
456
|
+ selection = int16_t(encoderPosition) > 0;
|
|
457
|
+ encoderPosition = 0;
|
457
|
458
|
}
|
458
|
|
- const bool got_click = ui.use_click();
|
|
459
|
+ return selection;
|
|
460
|
+}
|
|
461
|
+void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string/*=nullptr*/, PGM_P const suff/*=nullptr*/) {
|
|
462
|
+ const bool ui_selection = ui.update_selection(), got_click = ui.use_click();
|
459
|
463
|
if (got_click || ui.should_draw()) {
|
460
|
464
|
draw_select_screen(yes, no, ui_selection, pref, string, suff);
|
461
|
465
|
if (got_click) { ui_selection ? yesFunc() : noFunc(); }
|