|
@@ -135,8 +135,8 @@ Planner::Planner() { init(); }
|
135
|
135
|
|
136
|
136
|
void Planner::init() {
|
137
|
137
|
block_buffer_head = block_buffer_tail = 0;
|
138
|
|
- memset(position, 0, sizeof(position)); // clear position
|
139
|
|
- LOOP_XYZE(i) previous_speed[i] = 0.0;
|
|
138
|
+ memset(position, 0, sizeof(position));
|
|
139
|
+ memset(previous_speed, 0, sizeof(previous_speed));
|
140
|
140
|
previous_nominal_speed = 0.0;
|
141
|
141
|
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
|
142
|
142
|
bed_level_matrix.set_to_identity();
|
|
@@ -1134,7 +1134,7 @@ void Planner::buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, float fr_mm_s, co
|
1134
|
1134
|
block->recalculate_flag = true; // Always calculate trapezoid for new block
|
1135
|
1135
|
|
1136
|
1136
|
// Update previous path unit_vector and nominal speed
|
1137
|
|
- LOOP_XYZE(i) previous_speed[i] = current_speed[i];
|
|
1137
|
+ memcpy(previous_speed, current_speed, sizeof(previous_speed));
|
1138
|
1138
|
previous_nominal_speed = block->nominal_speed;
|
1139
|
1139
|
|
1140
|
1140
|
#if ENABLED(LIN_ADVANCE)
|
|
@@ -1180,8 +1180,8 @@ void Planner::buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, float fr_mm_s, co
|
1180
|
1180
|
// Move buffer head
|
1181
|
1181
|
block_buffer_head = next_buffer_head;
|
1182
|
1182
|
|
1183
|
|
- // Update position
|
1184
|
|
- LOOP_XYZE(i) position[i] = target[i];
|
|
1183
|
+ // Update the position (only when a move was queued)
|
|
1184
|
+ memcpy(position, target, sizeof(position));
|
1185
|
1185
|
|
1186
|
1186
|
recalculate();
|
1187
|
1187
|
|
|
@@ -1207,7 +1207,7 @@ void Planner::set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) {
|
1207
|
1207
|
stepper.set_position(nx, ny, nz, ne);
|
1208
|
1208
|
previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
|
1209
|
1209
|
|
1210
|
|
- LOOP_XYZE(i) previous_speed[i] = 0.0;
|
|
1210
|
+ memset(previous_speed, 0, sizeof(previous_speed));
|
1211
|
1211
|
}
|
1212
|
1212
|
|
1213
|
1213
|
/**
|