PFW-1504 implement stepper_get_machine_position_E_mm()
This function should be used when reading the current machine position while a move is ongoing No change in memory
This commit is contained in:
parent
690d83a94a
commit
59e1ac0396
|
|
@ -245,7 +245,7 @@ bool MMU2::VerifyFilamentEnteredPTFE() {
|
|||
|
||||
const float delta_mm = MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH - logic.ExtraLoadDistance();
|
||||
const float length_step_mm = 2 * (delta_mm) / (LCD_WIDTH + 1);
|
||||
float last_position = planner_get_machine_position_E_mm();
|
||||
float last_position = stepper_get_machine_position_E_mm();
|
||||
|
||||
TryLoadUnloadProgressbarInit();
|
||||
|
||||
|
|
@ -273,8 +273,8 @@ bool MMU2::VerifyFilamentEnteredPTFE() {
|
|||
fsensorStateLCD |= (WhereIsFilament() == FilamentState::NOT_PRESENT);
|
||||
fsensorState |= fsensorStateLCD; // No need to do the above comparison twice, just bitwise OR
|
||||
|
||||
if ((fabs(planner_get_machine_position_E_mm() - last_position)) > length_step_mm) {
|
||||
last_position = planner_get_machine_position_E_mm(); // Reset
|
||||
if ((fabs(stepper_get_machine_position_E_mm() - last_position)) > length_step_mm) {
|
||||
last_position = stepper_get_machine_position_E_mm(); // Reset
|
||||
TryLoadUnloadProgressbar(fsensorStateLCD);
|
||||
fsensorStateLCD = 0; // Clear temporary bit
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ float MoveRaiseZ(float delta);
|
|||
void planner_synchronize();
|
||||
bool planner_any_moves();
|
||||
float planner_get_machine_position_E_mm();
|
||||
float stepper_get_machine_position_E_mm();
|
||||
float planner_get_current_position_E();
|
||||
void planner_set_current_position_E(float e);
|
||||
void planner_line_to_current_position(float feedRate_mm_s);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ bool planner_any_moves() {
|
|||
}
|
||||
|
||||
float planner_get_machine_position_E_mm(){
|
||||
return current_position[E_AXIS];
|
||||
}
|
||||
|
||||
float stepper_get_machine_position_E_mm(){
|
||||
return st_get_position_mm(E_AXIS);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue