Fix some DGUS bugs

- No action on first click of the move button
This commit is contained in:
George Fu 2020-03-25 16:10:58 +08:00 committed by Scott Lahteine
parent e7f3b625b0
commit cbf349b5eb
4 changed files with 8 additions and 5 deletions

View file

@ -443,6 +443,7 @@ void DGUSScreenVariableHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variab
void DGUSScreenVariableHandler::SDCardInserted() { void DGUSScreenVariableHandler::SDCardInserted() {
top_file = 0; top_file = 0;
filelist.refresh();
auto cs = ScreenHandler.getCurrentScreen(); auto cs = ScreenHandler.getCurrentScreen();
if (cs == DGUSLCD_SCREEN_MAIN || cs == DGUSLCD_SCREEN_STATUS) if (cs == DGUSLCD_SCREEN_MAIN || cs == DGUSLCD_SCREEN_STATUS)
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDFILELIST); ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDFILELIST);
@ -614,8 +615,10 @@ void DGUSScreenVariableHandler::HandleManualMove(DGUS_VP_Variable &var, void *va
int16_t movevalue = swap16(*(uint16_t*)val_ptr); int16_t movevalue = swap16(*(uint16_t*)val_ptr);
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION) #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
const uint16_t choice = *(uint16_t*)var.memadr; if (movevalue) {
movevalue = movevalue > 0 ? choice : -choice; const uint16_t choice = *(uint16_t*)var.memadr;
movevalue = movevalue < 0 ? -choice : choice;
}
#endif #endif
char axiscode; char axiscode;
unsigned int speed = 1500; //FIXME: get default feedrate for manual moves, dont hardcode. unsigned int speed = 1500; //FIXME: get default feedrate for manual moves, dont hardcode.

View file

@ -37,7 +37,7 @@
#include "../../../../ultralcd.h" #include "../../../../ultralcd.h"
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION) #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
uint16_t distanceToMove = 0.1; uint16_t distanceToMove = 10;
#endif #endif
const uint16_t VPList_Boot[] PROGMEM = { const uint16_t VPList_Boot[] PROGMEM = {

View file

@ -37,7 +37,7 @@
#include "../../../../ultralcd.h" #include "../../../../ultralcd.h"
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION) #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
uint16_t distanceToMove = 0.1; uint16_t distanceToMove = 10;
#endif #endif
const uint16_t VPList_Boot[] PROGMEM = { const uint16_t VPList_Boot[] PROGMEM = {

View file

@ -36,7 +36,7 @@
#include "../../../../ultralcd.h" #include "../../../../ultralcd.h"
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION) #if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
uint16_t distanceToMove = 0.1; uint16_t distanceToMove = 10;
#endif #endif
const uint16_t VPList_Boot[] PROGMEM = { const uint16_t VPList_Boot[] PROGMEM = {