planner.cpp

changeset 1
b584642d4f58
parent 0
2c8ba1964db7
equal deleted inserted replaced
0:2c8ba1964db7 1:b584642d4f58
456 456
457 float junction_deviation = 0.1; 457 float junction_deviation = 0.1;
458 // Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in 458 // Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in
459 // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration 459 // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
460 // calculation the caller must also provide the physical length of the line in millimeters. 460 // calculation the caller must also provide the physical length of the line in millimeters.
461 void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder) 461 void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder, bool laser_on)
462 { 462 {
463 // Calculate the buffer head after we push this byte 463 // Calculate the buffer head after we push this byte
464 int next_buffer_head = next_block_index(block_buffer_head); 464 int next_buffer_head = next_block_index(block_buffer_head);
465 465
466 // If the buffer is full: good! That means we are well ahead of the robot. 466 // If the buffer is full: good! That means we are well ahead of the robot.
500 // Prepare to set up new block 500 // Prepare to set up new block
501 block_t *block = &block_buffer[block_buffer_head]; 501 block_t *block = &block_buffer[block_buffer_head];
502 502
503 // Mark block as not busy (Not executed by the stepper interrupt) 503 // Mark block as not busy (Not executed by the stepper interrupt)
504 block->busy = false; 504 block->busy = false;
505
506 // set the laser output status
507 block->laser_on = laser_on;
505 508
506 // Number of steps for each axis 509 // Number of steps for each axis
507 block->steps_x = labs(target[X_AXIS]-position[X_AXIS]); 510 block->steps_x = labs(target[X_AXIS]-position[X_AXIS]);
508 block->steps_y = labs(target[Y_AXIS]-position[Y_AXIS]); 511 block->steps_y = labs(target[Y_AXIS]-position[Y_AXIS]);
509 block->steps_z = labs(target[Z_AXIS]-position[Z_AXIS]); 512 block->steps_z = labs(target[Z_AXIS]-position[Z_AXIS]);

mercurial