Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bed_mesh: Restore originally-saved profiles on BED_MESH_CLEAR
BedMeshCalibrate.probe_finalize() updates the config file with the newly generated mesh data. That method is called during the completion of meshing. This means that every BED_MESH_CALIBRATE command updates the config file with new mesh data. This can lead to mesh profiles being unintentionally overwritten. This can happen because BED_MESH_CLEAR does not restore the old mesh data in the config file. So, if a user runs the following commands: BED_MESH_CALIBRATE BED_MESH_CLEAR ... SAVE_CONFIG the mesh will be saved despite the user having run BED_MESH_CLEAR. Fortunately, the newly generated bedmesh is stored in a separate section of the config that holds pending changes. Therefore, all that is needed in order to avoid storing a bed mesh is to remove the section for the current profile, which removes it from the set of pending changes. Signed-off-by: Mitko Haralanov <[email protected]>
- Loading branch information