Skip to content

Commit d26955b

Browse files
committed
🔧 Sanity check IA_CREALITY mesh size
1 parent c3694f1 commit d26955b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Marlin/src/inc/SanityCheck.h

+3
Original file line numberDiff line numberDiff line change
@@ -1552,6 +1552,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
15521552
#if HAS_MESH && HAS_CLASSIC_JERK
15531553
static_assert(DEFAULT_ZJERK > 0.1, "Low DEFAULT_ZJERK values are incompatible with mesh-based leveling.");
15541554
#endif
1555+
#if HAS_MESH && DGUS_LCD_UI_IA_CREALITY && GRID_MAX_POINTS > 25
1556+
#error "DGUS_LCD_UI IA_CREALITY requires a mesh with no more than 25 points as defined by GRID_MAX_POINTS_X/Y."
1557+
#endif
15551558

15561559
#if ENABLED(G26_MESH_VALIDATION)
15571560
#if !HAS_EXTRUDERS

Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ void RTS::handleData() {
674674
case DisplayStandbyBrightness: Checkkey = DisplayStandbyBrightness; break;
675675
case DisplayStandbySeconds: Checkkey = DisplayStandbySeconds; break;
676676
default:
677-
if (WITHIN(recdat.addr, AutolevelVal, 4400)) // (int16_t(AutolevelVal) + GRID_MAX_POINTS * 2) = 4400 with 5x5 mesh
677+
if (WITHIN(recdat.addr, AutolevelVal, AutolevelVal + 2 * (5 * 5 - 1))) // Assuming 5x5 mesh or smaller
678678
Checkkey = AutolevelVal;
679679
else if (WITHIN(recdat.addr, SDFILE_ADDR, SDFILE_ADDR + 10 * (FileNum + 1)))
680680
Checkkey = Filename;

Marlin/src/lcd/extui/ia_creality/ia_creality_rts.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ enum PROC_COM {
279279
};
280280

281281
const uint16_t Addrbuf[] = {
282-
0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1026, 0x1030, 0x1032, 0x1034, 0x103A,
282+
0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1026, 0x1030, 0x1032, 0x1034, 0x103A,
283283
0x103E, 0x1040, 0x1044, 0x1046, 0x1048, 0x104A, 0x104C, 0x1054, 0x1056, 0x1058,
284284
0x105C, 0x105E, 0x105F, 0x1088, 0
285285
};

0 commit comments

Comments
 (0)