From cee51cf9c3dd5685c742483d84b0c82df4cafe50 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 24 Sep 2018 15:40:35 +0200 Subject: [PATCH] Use cs.max_acceleration_units_per_sq_second_normal from ConfigurationStore. --- Firmware/ConfigurationStore.cpp | 6 +++--- Firmware/Marlin_main.cpp | 2 +- Firmware/planner.cpp | 5 ++--- Firmware/planner.h | 1 - 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Firmware/ConfigurationStore.cpp b/Firmware/ConfigurationStore.cpp index d8dabff7..c4afb22d 100644 --- a/Firmware/ConfigurationStore.cpp +++ b/Firmware/ConfigurationStore.cpp @@ -100,7 +100,7 @@ void Config_PrintSettings(uint8_t level) echomagic, echomagic, cs.axis_steps_per_unit[X_AXIS], cs.axis_steps_per_unit[Y_AXIS], cs.axis_steps_per_unit[Z_AXIS], cs.axis_steps_per_unit[E_AXIS], echomagic, echomagic, cs.max_feedrate_normal[X_AXIS], cs.max_feedrate_normal[Y_AXIS], cs.max_feedrate_normal[Z_AXIS], cs.max_feedrate_normal[E_AXIS], echomagic, echomagic, max_feedrate_silent[X_AXIS], max_feedrate_silent[Y_AXIS], max_feedrate_silent[Z_AXIS], max_feedrate_silent[E_AXIS], - echomagic, echomagic, max_acceleration_units_per_sq_second_normal[X_AXIS], max_acceleration_units_per_sq_second_normal[Y_AXIS], max_acceleration_units_per_sq_second_normal[Z_AXIS], max_acceleration_units_per_sq_second_normal[E_AXIS], + echomagic, echomagic, cs.max_acceleration_units_per_sq_second_normal[X_AXIS], cs.max_acceleration_units_per_sq_second_normal[Y_AXIS], cs.max_acceleration_units_per_sq_second_normal[Z_AXIS], cs.max_acceleration_units_per_sq_second_normal[E_AXIS], echomagic, echomagic, max_acceleration_units_per_sq_second_silent[X_AXIS], max_acceleration_units_per_sq_second_silent[Y_AXIS], max_acceleration_units_per_sq_second_silent[Z_AXIS], max_acceleration_units_per_sq_second_silent[E_AXIS], echomagic, echomagic, acceleration, retract_acceleration, echomagic, echomagic, minimumfeedrate, mintravelfeedrate, minsegmenttime, max_jerk[X_AXIS], max_jerk[Y_AXIS], max_jerk[Z_AXIS], max_jerk[E_AXIS], @@ -244,8 +244,8 @@ bool Config_RetrieveSettings(uint16_t offset) cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; if (max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; - if (max_acceleration_units_per_sq_second_normal[j] > NORMAL_MAX_ACCEL_XY) - max_acceleration_units_per_sq_second_normal[j] = NORMAL_MAX_ACCEL_XY; + if (cs.max_acceleration_units_per_sq_second_normal[j] > NORMAL_MAX_ACCEL_XY) + cs.max_acceleration_units_per_sq_second_normal[j] = NORMAL_MAX_ACCEL_XY; if (max_acceleration_units_per_sq_second_silent[j] > SILENT_MAX_ACCEL_XY) max_acceleration_units_per_sq_second_silent[j] = SILENT_MAX_ACCEL_XY; } diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index bfeb73e7..40de9ec5 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5892,7 +5892,7 @@ Sigma_Exit: if (val_silent > SILENT_MAX_ACCEL_XY) val_silent = SILENT_MAX_ACCEL_XY; } - max_acceleration_units_per_sq_second_normal[i] = val; + cs.max_acceleration_units_per_sq_second_normal[i] = val; max_acceleration_units_per_sq_second_silent[i] = val_silent; #else //TMC2130 max_acceleration_units_per_sq_second[i] = val; diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp index 07d35e4c..8f28ab71 100644 --- a/Firmware/planner.cpp +++ b/Firmware/planner.cpp @@ -80,9 +80,8 @@ float* max_feedrate = cs.max_feedrate_normal; // Use M201 to override by software -unsigned long max_acceleration_units_per_sq_second_normal[NUM_AXIS]; unsigned long max_acceleration_units_per_sq_second_silent[NUM_AXIS]; -unsigned long* max_acceleration_units_per_sq_second = max_acceleration_units_per_sq_second_normal; +unsigned long* max_acceleration_units_per_sq_second = cs.max_acceleration_units_per_sq_second_normal; float minimumfeedrate; float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX @@ -1324,7 +1323,7 @@ void update_mode_profile() if (tmc2130_mode == TMC2130_MODE_NORMAL) { max_feedrate = cs.max_feedrate_normal; - max_acceleration_units_per_sq_second = max_acceleration_units_per_sq_second_normal; + max_acceleration_units_per_sq_second = cs.max_acceleration_units_per_sq_second_normal; } else if (tmc2130_mode == TMC2130_MODE_SILENT) { diff --git a/Firmware/planner.h b/Firmware/planner.h index ebee45d6..18f4cd02 100644 --- a/Firmware/planner.h +++ b/Firmware/planner.h @@ -166,7 +166,6 @@ extern float* max_feedrate; // Use M201 to override by software -extern unsigned long max_acceleration_units_per_sq_second_normal[NUM_AXIS]; extern unsigned long max_acceleration_units_per_sq_second_silent[NUM_AXIS]; extern unsigned long* max_acceleration_units_per_sq_second;