From a85f60adb96c2ff9dfbeb96d0d3af79852cb07b5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Jun 2018 15:54:38 -0500 Subject: [PATCH] Unsigned eeprom mesh addresses --- Marlin/configuration_store.cpp | 2 +- Marlin/configuration_store.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 0b02fb182..778627e7d 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -1618,7 +1618,7 @@ void MarlinSettings::postprocess() { } #endif - int16_t MarlinSettings::meshes_start_index() { + uint16_t MarlinSettings::meshes_start_index() { return (datasize() + EEPROM_OFFSET + 32) & 0xFFF8; // Pad the end of configuration data so it can float up // or down a little bit without disrupting the mesh data } diff --git a/Marlin/configuration_store.h b/Marlin/configuration_store.h index 2bba57930..f7b50e092 100644 --- a/Marlin/configuration_store.h +++ b/Marlin/configuration_store.h @@ -53,8 +53,8 @@ class MarlinSettings { #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system // That can store is enabled - static int16_t meshes_start_index(); - FORCE_INLINE static int16_t meshes_end_index() { return meshes_end; } + static uint16_t meshes_start_index(); + FORCE_INLINE static uint16_t meshes_end_index() { return meshes_end; } static uint16_t calc_num_meshes(); static int mesh_slot_offset(const int8_t slot); static void store_mesh(const int8_t slot); @@ -84,8 +84,8 @@ class MarlinSettings { #if ENABLED(AUTO_BED_LEVELING_UBL) // Eventually make these available if any leveling system // That can store is enabled - static constexpr int16_t meshes_end = E2END - 128; // 128 is a placeholder for the size of the MAT; the MAT will always - // live at the very end of the eeprom + static constexpr uint16_t meshes_end = E2END - 128; // 128 is a placeholder for the size of the MAT; the MAT will always + // live at the very end of the eeprom #endif