Browse Source

Merge pull request #600 from xoan/Encoder_Pulses_Per_Step

add ENCODER_PULSES_PER_STEP
pull/1/head
ErikZalm 11 years ago
parent
commit
6a1e980c6d
  1. 5
      Marlin/ultralcd.cpp

5
Marlin/ultralcd.cpp

@ -88,6 +88,7 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
#if !defined(LCD_I2C_VIKI) #if !defined(LCD_I2C_VIKI)
#define ENCODER_STEPS_PER_MENU_ITEM 5 #define ENCODER_STEPS_PER_MENU_ITEM 5
#define ENCODER_PULSES_PER_STEP 1
#else #else
#define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation #define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
#endif #endif
@ -984,10 +985,10 @@ void lcd_update()
reprapworld_keypad_move_home(); reprapworld_keypad_move_home();
} }
#endif #endif
if (encoderDiff) if (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP)
{ {
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
encoderPosition += encoderDiff; encoderPosition += encoderDiff / ENCODER_PULSES_PER_STEP;
encoderDiff = 0; encoderDiff = 0;
timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS; timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
} }

Loading…
Cancel
Save