ソースを参照

add ENCODER_PULSES_PER_STEP

Xoan Sampaiño 11年前
コミット
bf7007d02f
1個のファイルの変更3行の追加2行の削除
  1. 3
    2
      Marlin/ultralcd.cpp

+ 3
- 2
Marlin/ultralcd.cpp ファイルの表示

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

読み込み中…
キャンセル
保存