From 361c4616cde5f8cbbb77b788b3687db08e943076 Mon Sep 17 00:00:00 2001 From: Neo2003 Date: Mon, 13 Mar 2023 22:55:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=BA=20DGUS=5FRELOADED=201.03=20(#25490?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp | 9 +++------ .../src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h | 12 ++++++------ .../extui/dgus_reloaded/definition/DGUS_VPList.cpp | 9 ++++----- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 3b90555cec0ca..111aa18d5d2fb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -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) diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index dc2aea8bef8a2..b27988a89f59a 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -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(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(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) { diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h index 39cc040f19a49..8cec8e59c9f20 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h @@ -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 @@ -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 @@ -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 diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp index 4def1c48f805b..3f00dbb0372b1 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp @@ -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), @@ -205,14 +204,14 @@ const struct DGUS_VP vp_list[] PROGMEM = { VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_Bed, &thermalManager.temp_bed.celsius, - &DGUSTxHandler::ExtraToInteger), + (&DGUSTxHandler::ExtraToFixedPoint)), VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_Bed, &thermalManager.temp_bed.target, &DGUSTxHandler::ExtraToInteger), 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), + (&DGUSTxHandler::ExtraToFixedPoint)), VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_H0, &thermalManager.temp_hotend[ExtUI::heater_t::H0].target, &DGUSTxHandler::ExtraToInteger), @@ -220,7 +219,7 @@ const struct DGUS_VP vp_list[] PROGMEM = { #if HAS_MULTI_HOTEND VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_H1, &thermalManager.temp_hotend[ExtUI::heater_t::H1].celsius, - &DGUSTxHandler::ExtraToInteger), + (&DGUSTxHandler::ExtraToFixedPoint)), VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_H1, &thermalManager.temp_hotend[ExtUI::heater_t::H1].target, &DGUSTxHandler::ExtraToInteger),