Browse Source

Fix encoder pulses for G3D_PANEL

Scott Lahteine 7 years ago
parent
commit
8a994fb1b1
3 changed files with 30 additions and 28 deletions
  1. 27
    15
      Marlin/Conditionals_LCD.h
  2. 2
    6
      Marlin/pins_ANET_10.h
  3. 1
    7
      Marlin/ultralcd.cpp

+ 27
- 15
Marlin/Conditionals_LCD.h View File

@@ -183,23 +183,35 @@
183 183
 
184 184
     #define ENCODER_FEEDRATE_DEADZONE 4
185 185
 
186
-    #ifndef ENCODER_PULSES_PER_STEP
187
-      #define ENCODER_PULSES_PER_STEP 1
188
-    #endif
189
-    #ifndef ENCODER_STEPS_PER_MENU_ITEM
190
-      #define ENCODER_STEPS_PER_MENU_ITEM 2
191
-    #endif
186
+    #define STD_ENCODER_PULSES_PER_STEP 1
187
+    #define STD_ENCODER_STEPS_PER_MENU_ITEM 2
188
+
189
+  #elif ENABLED(G3D_PANEL)
190
+
191
+    #define STD_ENCODER_PULSES_PER_STEP 2
192
+    #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
193
+
194
+  #elif ENABLED(miniVIKI) || ENABLED(VIKI2) \
195
+     || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
196
+     || ENABLED(OLED_PANEL_TINYBOY2) \
197
+     || ENABLED(BQ_LCD_SMART_CONTROLLER) \
198
+     || ENABLED(LCD_I2C_PANELOLU2) \
199
+     || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
200
+    #define STD_ENCODER_PULSES_PER_STEP 4
201
+    #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
192 202
   #endif
193 203
 
194
-  // Set encoder detents for well-known controllers
195
-  #if ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) || ENABLED(OLED_PANEL_TINYBOY2) \
196
-   || ENABLED(BQ_LCD_SMART_CONTROLLER) || ENABLED(LCD_I2C_PANELOLU2) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
197
-    #ifndef ENCODER_PULSES_PER_STEP
198
-      #define ENCODER_PULSES_PER_STEP 4
199
-    #endif
200
-    #ifndef ENCODER_STEPS_PER_MENU_ITEM
201
-      #define ENCODER_STEPS_PER_MENU_ITEM 1
202
-    #endif
204
+  #ifndef STD_ENCODER_PULSES_PER_STEP
205
+    #define STD_ENCODER_PULSES_PER_STEP 5
206
+  #endif
207
+  #ifndef STD_ENCODER_STEPS_PER_MENU_ITEM
208
+    #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
209
+  #endif
210
+  #ifndef ENCODER_PULSES_PER_STEP
211
+    #define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP
212
+  #endif
213
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
214
+    #define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM
203 215
   #endif
204 216
 
205 217
   // Shift register panels

+ 2
- 6
Marlin/pins_ANET_10.h View File

@@ -182,12 +182,8 @@
182 182
     #define ST7920_DELAY_1 DELAY_0_NOP
183 183
     #define ST7920_DELAY_2 DELAY_1_NOP
184 184
     #define ST7920_DELAY_3 DELAY_2_NOP
185
-    #ifndef ENCODER_STEPS_PER_MENU_ITEM
186
-      #define ENCODER_STEPS_PER_MENU_ITEM 1
187
-    #endif
188
-    #ifndef ENCODER_PULSES_PER_STEP
189
-      #define ENCODER_PULSES_PER_STEP 4
190
-    #endif
185
+    #define STD_ENCODER_PULSES_PER_STEP 4
186
+    #define STD_ENCODER_STEPS_PER_MENU_ITEM 1
191 187
   #endif
192 188
 #endif  // ULTRA_LCD && NEWPANEL
193 189
 

+ 1
- 7
Marlin/ultralcd.cpp View File

@@ -239,13 +239,7 @@ uint16_t max_display_update_time = 0;
239 239
   ////////////////////////////////////////////
240 240
 
241 241
   #ifndef ENCODER_FEEDRATE_DEADZONE
242
-    #define ENCODER_FEEDRATE_DEADZONE 10
243
-  #endif
244
-  #ifndef ENCODER_STEPS_PER_MENU_ITEM
245
-    #define ENCODER_STEPS_PER_MENU_ITEM 5
246
-  #endif
247
-  #ifndef ENCODER_PULSES_PER_STEP
248
-    #define ENCODER_PULSES_PER_STEP 1
242
+    #define ENCODER_FEEDRATE_DEADZONE 6
249 243
   #endif
250 244
 
251 245
   /**

Loading…
Cancel
Save