From 015d0594b01c42a43be446e3ef2311e5ede845a1 Mon Sep 17 00:00:00 2001 From: Robert F-C Date: Sun, 12 May 2013 07:51:28 +1000 Subject: [PATCH] Optimize menu selection for Viki rotary encoder. The Viki LCD rotary encoder uses a different number of steps per rotation. This fixes the seeming "missed" steps when selecting a menu. --- Marlin/ultralcd.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 2dae90a5d4..72404da032 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -76,7 +76,11 @@ static void menu_action_setting_edit_callback_float51(const char* pstr, float* p static void menu_action_setting_edit_callback_float52(const char* pstr, float* ptr, float minValue, float maxValue, menuFunc_t callbackFunc); static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, menuFunc_t callbackFunc); -#define ENCODER_STEPS_PER_MENU_ITEM 5 +#if !defined(LCD_I2C_VIKI) + #define ENCODER_STEPS_PER_MENU_ITEM 5 +#else + #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation +#endif /* Helper macros for menus */ #define START_MENU() do { \