Skip to content

Commit

Permalink
DGUS updates (#17260)
Browse files Browse the repository at this point in the history
  • Loading branch information
GerogeFu authored Mar 23, 2020
1 parent cd4060a commit e3ebbe2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
#error "More than 2 hotends not implemented on the Display UI design."
#endif

#include "DGUSDisplay.h"
#include "DGUSVPVariable.h"
#include "DGUSDisplayDef.h"

#include "../../ui_api.h"

#include "../../../../MarlinCore.h"
Expand All @@ -48,6 +44,10 @@
#include "../../../../feature/powerloss.h"
#endif

#include "DGUSDisplay.h"
#include "DGUSVPVariable.h"
#include "DGUSDisplayDef.h"

// Preamble... 2 Bytes, usually 0x5A 0xA5, but configurable
constexpr uint8_t DGUS_HEADER1 = 0x5A;
constexpr uint8_t DGUS_HEADER2 = 0xA5;
Expand Down Expand Up @@ -855,7 +855,7 @@ void DGUSScreenVariableHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable
void DGUSScreenVariableHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) {
DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged");

const float offset = float(swap16(*(uint16_t*)val_ptr)) / 100.0f;
const float offset = float(int16_t(swap16(*(uint16_t*)val_ptr))) / 100.0f;
ExtUI::setZOffset_mm(offset);
ScreenHandler.skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
return;
Expand Down
10 changes: 9 additions & 1 deletion Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ const uint16_t VPList_FLCPrinting[] PROGMEM = {
0x0000
};

const uint16_t VPList_Z_Offset[] PROGMEM = {
#if HOTENDS >= 1
VP_SD_Print_ProbeOffsetZ,
#endif
0x0000
};

const struct VPMapping VPMap[] PROGMEM = {
{ DGUSLCD_SCREEN_BOOT, VPList_Boot },
{ DGUSLCD_SCREEN_MAIN, VPList_Main },
Expand All @@ -291,6 +298,7 @@ const struct VPMapping VPMap[] PROGMEM = {
{ DGUSLCD_SCREEN_STATUS2, VPList_Status2 },
{ DGUSLCD_SCREEN_PREHEAT, VPList_Preheat },
{ DGUSLCD_SCREEN_MANUALMOVE, VPList_ManualMove },
{ DGUSLCD_SCREEN_Z_OFFSET, VPList_Z_Offset },
{ DGUSLCD_SCREEN_MANUALEXTRUDE, VPList_ManualExtrude },
{ DGUSLCD_SCREEN_FILAMENT_HEATING, VPList_Filament_heating },
{ DGUSLCD_SCREEN_FILAMENT_LOADING, VPList_Filament_load_unload },
Expand Down Expand Up @@ -361,7 +369,7 @@ const struct DGUS_VP_Variable ListOfVP[] PROGMEM = {
#if HOTENDS >= 1
VPHELPER(VP_T_E0_Is, &thermalManager.temp_hotend[0].celsius, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<0>),
VPHELPER(VP_T_E0_Set, &thermalManager.temp_hotend[0].target, DGUSScreenVariableHandler::HandleTemperatureChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_Flowrate_E0, nullptr, DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_Flowrate_E0, &planner.flow_percentage[ExtUI::extruder_t::E0], DGUSScreenVariableHandler::HandleFlowRateChanged, &DGUSScreenVariableHandler::DGUSLCD_SendWordValueToDisplay),
VPHELPER(VP_EPos, &destination.e, nullptr, DGUSScreenVariableHandler::DGUSLCD_SendFloatAsLongValueToDisplay<2>),
VPHELPER(VP_MOVE_E0, nullptr, &DGUSScreenVariableHandler::HandleManualExtrude, nullptr),
VPHELPER(VP_E0_CONTROL, &thermalManager.temp_hotend[0].target, &DGUSScreenVariableHandler::HandleHeaterControl, nullptr),
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/extui/lib/dgus/hiprecy/DGUSDisplayDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum DGUSLCD_Screens : uint8_t {
DGUSLCD_SCREEN_FILAMENT_LOADING = 76,
DGUSLCD_SCREEN_FILAMENT_UNLOADING = 82,
DGUSLCD_SCREEN_MANUALEXTRUDE = 84,
DGUSLCD_SCREEN_Z_OFFSET = 88,
DGUSLCD_SCREEN_SDFILELIST = 3,
DGUSLCD_SCREEN_SDPRINTMANIPULATION = 7,
DGUSLCD_SCREEN_SDPRINTTUNE = 9,
Expand Down

0 comments on commit e3ebbe2

Please sign in to comment.