Skip to content

Commit

Permalink
📺 DGUS_RELOADED 1.03 (#25490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo2003 authored and thinkyhead committed Apr 10, 2023
1 parent a665aad commit 361c461
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -3044,7 +3044,7 @@
* - Product: https://www.aliexpress.com/item/1005002008179262.html
*
* RELOADED (T5UID1)
* - Download https://github.com/Desuuuu/DGUS-reloaded/releases
* - Download https://github.com/Neo2003/DGUS-reloaded/releases
* - Copy the downloaded DWIN_SET folder to the SD card.
*
* IA_CREALITY (T5UID1)
Expand Down
9 changes: 3 additions & 6 deletions Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,9 @@
#endif // SDSUPPORT

void DGUSTxHandler::PositionZ(DGUS_VP &vp) {
float position = ExtUI::isAxisPositionKnown(ExtUI::Z) ?
planner.get_axis_position_mm(Z_AXIS)
: 0;

const int16_t data = dgus_display.ToFixedPoint<float, int16_t, 1>(position);
dgus_display.Write((uint16_t)vp.addr, Swap16(data));
const float position = ExtUI::isAxisPositionKnown(ExtUI::Z) ? planner.get_axis_position_mm(Z_AXIS) : 0;
const int32_t data = dgus_display.ToFixedPoint<float, int32_t, 2>(int32_t(position * 50.0f) / 50.0f); // Round to 0.02
dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data));
}

void DGUSTxHandler::Elapsed(DGUS_VP &vp) {
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ enum class DGUS_Addr : uint16_t {
SD_FileName4 = 0x30A5, // 0x30A5 - 0x30C4
SD_ScrollIcons = 0x30C5, // Bits: DGUS_Data::ScrollIcon
SD_SelectedFileName = 0x30C6, // 0x30C6 - 0x30E5
STATUS_PositionZ = 0x30E6, // Type: Fixed point, 1 decimal (16 bits signed)
STATUS_Elapsed = 0x30E7, // 0x30E7 - 0x30F5
STATUS_Percent = 0x30F6, // Type: Integer (16 bits unsigned)
STATUS_Icons = 0x30F7, // Bits: DGUS_Data::StatusIcon
STATUS_PositionZ = 0x30E6, // Type: Fixed point, 2 decimal (32 bits signed)
STATUS_Elapsed = 0x30E8, // 0x30E8 - 0x30F6
STATUS_Percent = 0x30F7, // Type: Integer (16 bits unsigned)
ADJUST_Feedrate = 0x30F8, // Type: Integer (16 bits signed)
ADJUST_Flowrate_CUR = 0x30F9, // Type: Integer (16 bits signed)
#if HAS_MULTI_EXTRUDER
Expand All @@ -120,11 +119,11 @@ enum class DGUS_Addr : uint16_t {
TEMP_Current_Bed = 0x30FC, // Type: Integer (16 bits signed)
TEMP_Target_Bed = 0x30FD, // Type: Integer (16 bits signed)
TEMP_Max_Bed = 0x30FE, // Type: Integer (16 bits unsigned)
TEMP_Current_H0 = 0x30FF, // Type: Integer (16 bits signed)
TEMP_Current_H0 = 0x30FF, // Type: Fixed point, 1 decimal (16 bits signed)
TEMP_Target_H0 = 0x3100, // Type: Integer (16 bits signed)
TEMP_Max_H0 = 0x3101, // Type: Integer (16 bits unsigned)
#if HAS_MULTI_HOTEND
TEMP_Current_H1 = 0x3102, // Type: Integer (16 bits signed)
TEMP_Current_H1 = 0x3102, // Type: Fixed point, 1 decimal (16 bits signed)
TEMP_Target_H1 = 0x3103, // Type: Integer (16 bits signed)
TEMP_Max_H1 = 0x3104, // Type: Integer (16 bits unsigned)
#endif
Expand Down Expand Up @@ -156,6 +155,7 @@ enum class DGUS_Addr : uint16_t {
INFOS_LongestPrint = 0x318D, // 0x318D - 0x31A4
INFOS_FilamentUsed = 0x31A5, // 0x31A5 - 0x31BC
WAIT_Icons = 0x31BD, // Bits: DGUS_Data::WaitIcon
STATUS_Icons = 0x31BE, // Bits: DGUS_Data::StatusIcon

// READ-WRITE VARIABLES

Expand Down
9 changes: 4 additions & 5 deletions Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
VP_HELPER_RX(DGUS_Addr::LEVEL_MANUAL_Point, &DGUSRxHandler::MoveToPoint),

VP_HELPER_RX_NODATA(DGUS_Addr::LEVEL_AUTO_Probe, &DGUSRxHandler::Probe),
VP_HELPER_RX_NODATA(DGUS_Addr::LEVEL_AUTO_Disable,
&DGUSRxHandler::DisableABL),
VP_HELPER_RX_NODATA(DGUS_Addr::LEVEL_AUTO_Disable, &DGUSRxHandler::DisableABL),

VP_HELPER_RX(DGUS_Addr::FILAMENT_Select, &DGUSRxHandler::FilamentSelect),
VP_HELPER_RX(DGUS_Addr::FILAMENT_SetLength, &DGUSRxHandler::FilamentLength),
Expand Down Expand Up @@ -205,22 +204,22 @@ const struct DGUS_VP vp_list[] PROGMEM = {

VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_Bed,
&thermalManager.temp_bed.celsius,
&DGUSTxHandler::ExtraToInteger<float>),
(&DGUSTxHandler::ExtraToFixedPoint<float, 1>)),
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_Bed,
&thermalManager.temp_bed.target,
&DGUSTxHandler::ExtraToInteger<int16_t>),
VP_HELPER_TX(DGUS_Addr::TEMP_Max_Bed, &DGUSTxHandler::TempMax),
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_H0,
&thermalManager.temp_hotend[ExtUI::heater_t::H0].celsius,
&DGUSTxHandler::ExtraToInteger<float>),
(&DGUSTxHandler::ExtraToFixedPoint<float, 1>)),
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_H0,
&thermalManager.temp_hotend[ExtUI::heater_t::H0].target,
&DGUSTxHandler::ExtraToInteger<int16_t>),
VP_HELPER_TX(DGUS_Addr::TEMP_Max_H0, &DGUSTxHandler::TempMax),
#if HAS_MULTI_HOTEND
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_H1,
&thermalManager.temp_hotend[ExtUI::heater_t::H1].celsius,
&DGUSTxHandler::ExtraToInteger<float>),
(&DGUSTxHandler::ExtraToFixedPoint<float, 1>)),
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_H1,
&thermalManager.temp_hotend[ExtUI::heater_t::H1].target,
&DGUSTxHandler::ExtraToInteger<int16_t>),
Expand Down

0 comments on commit 361c461

Please sign in to comment.