29 #ifdef ENABLE_AUTO_BED_LEVELING
36 BLOCK_FLAG_RECALCULATE = 1,
39 BLOCK_FLAG_NOMINAL_LENGTH = 2,
42 BLOCK_FLAG_START_FROM_FULL_HALT = 4,
46 BLOCK_FLAG_DDA_LOWRES = 8,
48 BLOCK_FLAG_E_RESET = 16,
76 uint32_t acceleration_rate;
77 unsigned char direction_bits;
79 uint32_t accelerate_until;
80 uint32_t decelerate_after;
91 float max_entry_speed;
102 uint32_t nominal_rate;
103 uint32_t initial_rate;
105 uint32_t acceleration_steps_per_s2;
114 bool use_advance_lead;
115 uint16_t advance_rate,
118 uint8_t advance_step_loops;
123 float gcode_start_position[NUM_AXIS];
124 uint16_t segment_idx;
125 uint16_t gcode_feedrate;
130 extern float extruder_advance_K;
133 #ifdef ENABLE_AUTO_BED_LEVELING
144 #ifdef ENABLE_AUTO_BED_LEVELING
145 void plan_buffer_line(
float x,
float y,
float z,
const float &e,
float feed_rate);
155 void plan_buffer_line_curposXYZE(
float feed_rate);
157 void plan_buffer_line_destinationXYZE(
float feed_rate);
159 void plan_set_position_curposXYZE();
161 void plan_buffer_line(
float x,
float y,
float z,
const float &e,
float feed_rate,
const float* gcode_start_position = NULL, uint16_t segment_idx = 0);
167 void plan_set_position(
float x,
float y,
float z,
const float &e);
172 void plan_set_z_position(
const float &z);
173 void plan_set_e_position(
const float &e);
176 void plan_reset_next_e();
178 inline void set_current_to_destination() { memcpy(current_position, destination,
sizeof(current_position)); }
179 inline void set_destination_to_current() { memcpy(destination, current_position,
sizeof(destination)); }
181 extern bool e_active();
183 void check_axes_activity();
186 extern float* max_feedrate;
190 extern uint32_t* max_acceleration_mm_per_s2;
191 extern uint32_t max_acceleration_steps_per_s2[NUM_AXIS];
193 extern long position[NUM_AXIS];
197 extern bool autotemp_enabled;
198 extern float autotemp_max;
199 extern float autotemp_min;
200 extern float autotemp_factor;
205 static_assert(!(BLOCK_BUFFER_SIZE & (BLOCK_BUFFER_SIZE - 1)),
206 "BLOCK_BUFFER_SIZE must be a power of two");
207 static_assert(BLOCK_BUFFER_SIZE <= (UINT8_MAX>>1),
208 "BLOCK_BUFFER_SIZE too large for uint8_t");
210 extern block_t block_buffer[BLOCK_BUFFER_SIZE];
212 extern volatile uint8_t block_buffer_head;
216 extern volatile uint8_t block_buffer_tail;
219 FORCE_INLINE
void plan_discard_current_block()
221 if (block_buffer_head != block_buffer_tail) {
222 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1);
230 FORCE_INLINE
block_t *plan_get_current_block()
232 if (block_buffer_head == block_buffer_tail) {
235 block_t *block = &block_buffer[block_buffer_tail];
241 FORCE_INLINE
bool blocks_queued() {
242 return (block_buffer_head != block_buffer_tail);
246 FORCE_INLINE uint8_t moves_planned() {
247 return (block_buffer_head + BLOCK_BUFFER_SIZE - block_buffer_tail) & (BLOCK_BUFFER_SIZE - 1);
250 FORCE_INLINE
bool planner_queue_full() {
251 uint8_t next_block_index = block_buffer_head;
252 if (++ next_block_index == BLOCK_BUFFER_SIZE)
253 next_block_index = 0;
254 return block_buffer_tail == next_block_index;
258 extern void planner_reset_position();
263 extern void planner_abort_hard();
264 extern bool planner_aborted;
266 #ifdef PREVENT_DANGEROUS_EXTRUDE
267 extern int extrude_min_temp;
268 void set_extrude_min_temp(
int temp);
271 void reset_acceleration_rates();
274 void update_mode_profile();
277 #ifdef PLANNER_DIAGNOSTICS
279 extern uint8_t planner_queue_min();
281 extern void planner_queue_min_reset();
284 extern void planner_add_sd_length(uint16_t sdlen);
286 extern uint16_t planner_calc_sd_length();
Definition: vector_3.h:46
Definition: vector_3.h:26