Browse Source

Merge pull request #2155 from leptun/MK3_SD_scroll_workaround

SD Scroll workaround
DRracer 5 years ago
parent
commit
ce5efb107a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Firmware/ultralcd.cpp

+ 2 - 2
Firmware/ultralcd.cpp

@@ -313,7 +313,7 @@ const char STR_SEPARATOR[] PROGMEM = "------------";
 static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, char* longFilename)
 {
     char c;
-    int enc_dif = lcd_encoder_diff;
+    int enc_dif = lcd_encoder_diff / ENCODER_PULSES_PER_STEP;
     uint8_t n = LCD_WIDTH - 1;
     for(uint_least8_t g = 0; g<4;g++){
       lcd_set_cursor(0, g);
@@ -339,7 +339,7 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, char* longF
           n = LCD_WIDTH - 1;
           for(int g = 0; g<300 ;g++){
 			  manage_heater();
-            if(LCD_CLICKED || ( enc_dif != lcd_encoder_diff )){
+            if(LCD_CLICKED || ( enc_dif != (lcd_encoder_diff / ENCODER_PULSES_PER_STEP))){
 				longFilenameTMP = longFilename;
 				*(longFilenameTMP + LCD_WIDTH - 2) = '\0';
 				i = 1;