Skip to content

Commit

Permalink
Merge pull request MarlinFirmware#600 from xoan/Encoder_Pulses_Per_Step
Browse files Browse the repository at this point in the history
add ENCODER_PULSES_PER_STEP
  • Loading branch information
ErikZalm committed Sep 14, 2013
2 parents 20076a8 + bf7007d commit 6a1e980
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Marlin/ultralcd.cpp
Expand Up @@ -88,6 +88,7 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l

#if !defined(LCD_I2C_VIKI)
#define ENCODER_STEPS_PER_MENU_ITEM 5
#define ENCODER_PULSES_PER_STEP 1
#else
#define ENCODER_STEPS_PER_MENU_ITEM 2 // VIKI LCD rotary encoder uses a different number of steps per rotation
#endif
Expand Down Expand Up @@ -984,10 +985,10 @@ void lcd_update()
reprapworld_keypad_move_home();
}
#endif
if (encoderDiff)
if (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP)
{
lcdDrawUpdate = 1;
encoderPosition += encoderDiff;
encoderPosition += encoderDiff / ENCODER_PULSES_PER_STEP;
encoderDiff = 0;
timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
}
Expand Down

0 comments on commit 6a1e980

Please sign in to comment.