Browse Source

Fix some DGUS bugs

- No action on first click of the move button
George Fu 4 years ago
parent
commit
cbf349b5eb

+ 5
- 2
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp View File

443
 
443
 
444
   void DGUSScreenVariableHandler::SDCardInserted() {
444
   void DGUSScreenVariableHandler::SDCardInserted() {
445
     top_file = 0;
445
     top_file = 0;
446
+    filelist.refresh();
446
     auto cs = ScreenHandler.getCurrentScreen();
447
     auto cs = ScreenHandler.getCurrentScreen();
447
     if (cs == DGUSLCD_SCREEN_MAIN || cs == DGUSLCD_SCREEN_STATUS)
448
     if (cs == DGUSLCD_SCREEN_MAIN || cs == DGUSLCD_SCREEN_STATUS)
448
       ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDFILELIST);
449
       ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDFILELIST);
614
 
615
 
615
   int16_t movevalue = swap16(*(uint16_t*)val_ptr);
616
   int16_t movevalue = swap16(*(uint16_t*)val_ptr);
616
   #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
617
   #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
617
-    const uint16_t choice = *(uint16_t*)var.memadr;
618
-    movevalue = movevalue > 0 ? choice : -choice;
618
+    if (movevalue) {
619
+      const uint16_t choice = *(uint16_t*)var.memadr;
620
+      movevalue = movevalue < 0 ? -choice : choice;
621
+    }
619
   #endif
622
   #endif
620
   char axiscode;
623
   char axiscode;
621
   unsigned int speed = 1500;  //FIXME: get default feedrate for manual moves, dont hardcode.
624
   unsigned int speed = 1500;  //FIXME: get default feedrate for manual moves, dont hardcode.

+ 1
- 1
Marlin/src/lcd/extui/lib/dgus/fysetc/DGUSDisplayDef.cpp View File

37
 #include "../../../../ultralcd.h"
37
 #include "../../../../ultralcd.h"
38
 
38
 
39
 #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
39
 #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
40
-  uint16_t distanceToMove = 0.1;
40
+  uint16_t distanceToMove = 10;
41
 #endif
41
 #endif
42
 
42
 
43
 const uint16_t VPList_Boot[] PROGMEM = {
43
 const uint16_t VPList_Boot[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp View File

37
 #include "../../../../ultralcd.h"
37
 #include "../../../../ultralcd.h"
38
 
38
 
39
 #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
39
 #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
40
-  uint16_t distanceToMove = 0.1;
40
+  uint16_t distanceToMove = 10;
41
 #endif
41
 #endif
42
 
42
 
43
 const uint16_t VPList_Boot[] PROGMEM = {
43
 const uint16_t VPList_Boot[] PROGMEM = {

+ 1
- 1
Marlin/src/lcd/extui/lib/dgus/origin/DGUSDisplayDef.cpp View File

36
 #include "../../../../ultralcd.h"
36
 #include "../../../../ultralcd.h"
37
 
37
 
38
 #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
38
 #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
39
-  uint16_t distanceToMove = 0.1;
39
+  uint16_t distanceToMove = 10;
40
 #endif
40
 #endif
41
 
41
 
42
 const uint16_t VPList_Boot[] PROGMEM = {
42
 const uint16_t VPList_Boot[] PROGMEM = {

Loading…
Cancel
Save