|
@@ -23,8 +23,6 @@ static_assert(EXTRUDERS==1);
|
|
|
|
|
|
namespace MMU2 {
|
|
|
|
|
|
-void execute_extruder_sequence(const E_Step *sequence, int steps);
|
|
|
-
|
|
|
template<typename F>
|
|
|
void waitForHotendTargetTemp(uint16_t delay, F f){
|
|
|
while (((degTargetHotend(active_extruder) - degHotend(active_extruder)) > 5)) {
|
|
@@ -357,7 +355,7 @@ bool MMU2::tool_change(char code, uint8_t slot) {
|
|
|
|
|
|
case 'c': {
|
|
|
waitForHotendTargetTemp(100, []{});
|
|
|
- execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
|
|
|
+ execute_load_to_nozzle_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
|
|
|
} break;
|
|
|
}
|
|
|
|
|
@@ -508,7 +506,7 @@ bool MMU2::load_filament_to_nozzle(uint8_t slot) {
|
|
|
ToolChangeCommon(slot);
|
|
|
|
|
|
// Finish loading to the nozzle with finely tuned steps.
|
|
|
- execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
|
|
|
+ execute_load_to_nozzle_sequence((const E_Step *)load_to_nozzle_sequence, sizeof(load_to_nozzle_sequence) / sizeof (load_to_nozzle_sequence[0]));
|
|
|
Sound_MakeSound(e_SOUND_TYPE_StandardConfirm);
|
|
|
}
|
|
|
lcd_update_enable(true);
|
|
@@ -839,6 +837,13 @@ void MMU2::execute_extruder_sequence(const E_Step *sequence, uint8_t steps) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void MMU2::execute_load_to_nozzle_sequence(const E_Step *sequence, uint8_t steps) {
|
|
|
+ st_synchronize();
|
|
|
+ // Compensate for configurable Extra Loading Distance
|
|
|
+ current_position[E_AXIS] -= logic.ExtraLoadDistance();
|
|
|
+ execute_extruder_sequence(sequence, steps);
|
|
|
+}
|
|
|
+
|
|
|
void MMU2::ReportError(ErrorCode ec, ErrorSource res) {
|
|
|
// Due to a potential lossy error reporting layers linked to this hook
|
|
|
// we'd better report everything to make sure especially the error states
|