Browse Source

Merge pull request #5887 from Roxy-3D/RCBugFix

Double Click of Encoder Wheel Jumps to Z-BabyStepping
pull/1/head
Roxy-3D 8 years ago
committed by GitHub
parent
commit
11e892bd84
  1. 11
      Marlin/Configuration_adv.h
  2. 23
      Marlin/ultralcd.cpp

11
Marlin/Configuration_adv.h

@ -1129,6 +1129,17 @@
//#define EXTENDED_CAPABILITIES_REPORT //#define EXTENDED_CAPABILITIES_REPORT
/**
* Double Clicking of LCD Panel's Encoder Wheel while at the Status Screen will jump
* to the Z-BabyStepping menu.
*/
//#define DOUBLE_CLICK_JUMPS_TO_Z_BABYSTEPPING
#define DOUBLE_CLICK_TIME_WINDOW 1250 // How quickly the double click must be done in miliseconds.
// Please notice this time must be a little bit longer than what
// is actually desired because there is some latency in detecting a
// change in LCD Panel Button Status.
/** /**
* Volumetric extrusion default state * Volumetric extrusion default state
* Activate to make volumetric extrusion the default method, * Activate to make volumetric extrusion the default method,

23
Marlin/ultralcd.cpp

@ -49,6 +49,12 @@ int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2
millis_t previous_lcd_status_ms = 0; millis_t previous_lcd_status_ms = 0;
#endif #endif
#if ENABLED(BABYSTEPPING)
long babysteps_done = 0;
millis_t status_screen_click_time = 0;
static void lcd_babystep_z();
#endif
uint8_t lcd_status_message_level; uint8_t lcd_status_message_level;
char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1 char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
@ -411,6 +417,21 @@ uint16_t max_display_update_time = 0;
* General function to go directly to a screen * General function to go directly to a screen
*/ */
void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) { void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) {
#ifdef DOUBLE_CLICK_JUMPS_TO_Z_BABYSTEPPING
#if ENABLED(BABYSTEPPING)
if (currentScreen==lcd_status_screen && screen==lcd_main_menu) // We are in leaving the status screen to goto the main_menu
status_screen_click_time = millis(); // screen. Mark the time so we know how quick the user is
// pressing buttons.
if (currentScreen==lcd_main_menu) {
if ( screen==lcd_status_screen && status_screen_click_time+DOUBLE_CLICK_TIME_WINDOW>millis() ) {
lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
status_screen_click_time = 0;
lcd_babystep_z();
return;
}
}
#endif
#endif
if (currentScreen != screen) { if (currentScreen != screen) {
currentScreen = screen; currentScreen = screen;
encoderPosition = encoder; encoderPosition = encoder;
@ -756,8 +777,6 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
long babysteps_done = 0;
void _lcd_babystep(const AxisEnum axis, const char* msg) { void _lcd_babystep(const AxisEnum axis, const char* msg) {
if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); } if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
ENCODER_DIRECTION_NORMAL(); ENCODER_DIRECTION_NORMAL();

Loading…
Cancel
Save