mbl settings initialization fix

This commit is contained in:
PavelSindler 2019-03-13 15:05:10 +01:00
parent c3a95ab79b
commit 6c70d59810
2 changed files with 5 additions and 6 deletions

View File

@ -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 !!!!!

View File

@ -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) {