🐛 Fix kinetic ABL mesh after refactor (#24107)

Followup to #23868
This commit is contained in:
tombrazier
2022-04-29 18:54:57 +01:00
committed by GitHub
parent e633ef895d
commit 60b6df4542
4 changed files with 8 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
class LevelingBilinear { class LevelingBilinear {
private:
static xy_pos_t grid_spacing, grid_start; static xy_pos_t grid_spacing, grid_start;
static xy_float_t grid_factor; static xy_float_t grid_factor;
static bed_mesh_t z_values; static bed_mesh_t z_values;

View File

@@ -507,6 +507,10 @@ G29_TYPE GcodeSuite::G29() {
// Can't re-enable (on error) until the new grid is written // Can't re-enable (on error) until the new grid is written
abl.reenable = false; abl.reenable = false;
} }
// Pre-populate local Z values from the stored mesh
TERN_(IS_KINEMATIC, COPY(abl.z_values, Z_VALUES_ARR));
#endif // AUTO_BED_LEVELING_BILINEAR #endif // AUTO_BED_LEVELING_BILINEAR
} // !g29_in_progress } // !g29_in_progress

View File

@@ -200,7 +200,7 @@ void DGUSScreenHandler::StoreSettings(char *buff) {
data.initialized = true; data.initialized = true;
data.volume = dgus_display.GetVolume(); data.volume = dgus_display.GetVolume();
data.brightness = dgus_display.GetBrightness(); data.brightness = dgus_display.GetBrightness();
data.abl = (ExtUI::getLevelingActive() && ExtUI::getMeshValid()); data.abl_okay = (ExtUI::getLevelingActive() && ExtUI::getMeshValid());
memcpy(buff, &data, sizeof(data)); memcpy(buff, &data, sizeof(data));
} }
@@ -216,8 +216,7 @@ void DGUSScreenHandler::LoadSettings(const char *buff) {
dgus_display.SetBrightness(data.initialized ? data.brightness : DGUS_DEFAULT_BRIGHTNESS); dgus_display.SetBrightness(data.initialized ? data.brightness : DGUS_DEFAULT_BRIGHTNESS);
if (data.initialized) { if (data.initialized) {
leveling_active = (data.abl && ExtUI::getMeshValid()); leveling_active = (data.abl_okay && ExtUI::getMeshValid());
ExtUI::setLevelingActive(leveling_active); ExtUI::setLevelingActive(leveling_active);
} }
} }

View File

@@ -134,7 +134,7 @@ private:
bool initialized; bool initialized;
uint8_t volume; uint8_t volume;
uint8_t brightness; uint8_t brightness;
bool abl; bool abl_okay;
} eeprom_data_t; } eeprom_data_t;
}; };