From d26955bde6d64430ed46422f3ec575317c648837 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 14 Jun 2023 19:06:17 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Sanity=20check=20IA=5FCREALITY?= =?UTF-8?q?=20mesh=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 3 +++ Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp | 2 +- Marlin/src/lcd/extui/ia_creality/ia_creality_rts.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 361c63af4d..ab4b0e4e12 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1552,6 +1552,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #if HAS_MESH && HAS_CLASSIC_JERK static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling."); #endif +#if HAS_MESH && DGUS_LCD_UI_IA_CREALITY && GRID_MAX_POINTS > 25 + #error "DGUS_LCD_UI IA_CREALITY requires a mesh with no more than 25 points as defined by GRID_MAX_POINTS_X/Y." +#endif #if ENABLED(G26_MESH_VALIDATION) #if !HAS_EXTRUDERS diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index 3eac438bb1..a64fa2ef20 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -674,7 +674,7 @@ void RTS::handleData() { case DisplayStandbyBrightness: Checkkey = DisplayStandbyBrightness; break; case DisplayStandbySeconds: Checkkey = DisplayStandbySeconds; break; default: - if (WITHIN(recdat.addr, AutolevelVal, 4400)) // (int16_t(AutolevelVal) + GRID_MAX_POINTS * 2) = 4400 with 5x5 mesh + if (WITHIN(recdat.addr, AutolevelVal, AutolevelVal + 2 * (5 * 5 - 1))) // Assuming 5x5 mesh or smaller Checkkey = AutolevelVal; else if (WITHIN(recdat.addr, SDFILE_ADDR, SDFILE_ADDR + 10 * (FileNum + 1))) Checkkey = Filename; diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.h b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.h index 9ec7d7872f..3b467f4d25 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.h +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.h @@ -279,7 +279,7 @@ enum PROC_COM { }; const uint16_t Addrbuf[] = { - 0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1026, 0x1030, 0x1032, 0x1034, 0x103A, + 0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1026, 0x1030, 0x1032, 0x1034, 0x103A, 0x103E, 0x1040, 0x1044, 0x1046, 0x1048, 0x104A, 0x104C, 0x1054, 0x1056, 0x1058, 0x105C, 0x105E, 0x105F, 0x1088, 0 };