From 41d0b77d1748b45763126398942cf7376c6d82b3 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:16:51 +0100 Subject: [PATCH] Copy over move data from previous printer config --- CYD-Klipper/src/conf/global_config.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CYD-Klipper/src/conf/global_config.cpp b/CYD-Klipper/src/conf/global_config.cpp index d173fd3..768155a 100644 --- a/CYD-Klipper/src/conf/global_config.cpp +++ b/CYD-Klipper/src/conf/global_config.cpp @@ -85,11 +85,18 @@ void set_printer_config_index(int index) new_config->color_scheme = old_config->color_scheme; + // TODO: Replace with memcpy for (int i = 0; i < 3; i++){ new_config->hotend_presets[i] = old_config->hotend_presets[i]; new_config->bed_presets[i] = old_config->bed_presets[i]; } + for (int i = 0; i < 3; i++){ + new_config->printer_move_x_steps[i] = old_config->printer_move_x_steps[i]; + new_config->printer_move_y_steps[i] = old_config->printer_move_y_steps[i]; + new_config->printer_move_z_steps[i] = old_config->printer_move_z_steps[i]; + } + write_global_config(); ESP.restart(); }