From 6c70d598100a6801e70e1020e0efa64671c164a1 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Wed, 13 Mar 2019 15:05:10 +0100 Subject: [PATCH] mbl settings initialization fix --- Firmware/eeprom.h | 2 +- Firmware/mesh_bed_calibration.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index 56ee5f77..c96e1d8d 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -158,7 +158,7 @@ #define EEPROM_MBL_TYPE (EEPROM_UVLO_MESH_BED_LEVELING_FULL-1) //uint8_t for mesh bed leveling precision #define EEPROM_MBL_MAGNET_ELIMINATION (EEPROM_MBL_TYPE -1) #define EEPROM_MBL_POINTS_NR (EEPROM_MBL_MAGNET_ELIMINATION -1) //uint8_t number of points in one exis for mesh bed leveling -#define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) +#define EEPROM_MBL_PROBE_NR (EEPROM_MBL_POINTS_NR-1) //number of measurements for each point #define EEPROM_MMU_STEALTH (EEPROM_MBL_PROBE_NR-1) // !!!!! // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!! diff --git a/Firmware/mesh_bed_calibration.cpp b/Firmware/mesh_bed_calibration.cpp index 0a675550..e50fb435 100644 --- a/Firmware/mesh_bed_calibration.cpp +++ b/Firmware/mesh_bed_calibration.cpp @@ -3088,15 +3088,14 @@ void mbl_settings_init() { if (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) == 0xFF) { eeprom_update_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION, 1); } - if (eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR) == 0xFF) { - eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); + if (eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR) == 0xFF) { + eeprom_update_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); } - mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); + mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); if (mbl_z_probe_nr == 0xFF) { mbl_z_probe_nr = 3; - eeprom_update_byte((uint8_t*)EEPROM_MBL_POINTS_NR, mbl_z_probe_nr); + eeprom_update_byte((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } - } bool mbl_point_measurement_valid(uint8_t ix, uint8_t iy, uint8_t meas_points, bool zigzag) {