PFW-1386 Implement changes to M702

This commit is contained in:
Guðni Már Gilbert 2022-08-27 09:39:51 +00:00 committed by D.R.racer
parent 9b0d89213b
commit 32ec1587b9
1 changed files with 23 additions and 14 deletions

View File

@ -8587,23 +8587,32 @@ Sigma_Exit:
### M702 - Unload filament <a href="https://reprap.org/wiki/G-code#M702:_Unload_filament">G32: Undock Z Probe sled</a> ### M702 - Unload filament <a href="https://reprap.org/wiki/G-code#M702:_Unload_filament">G32: Undock Z Probe sled</a>
#### Usage #### Usage
M702 [ C ] M702 [ U | Z ]
#### Parameters #### Parameters
- `C` - Unload just current filament - `U` - Retract distance for removal (manual reload). Default value is 0.
- without any parameters unload all filaments - `Z` - Move the Z axis by this distance. Default value MIN_Z_FOR_UNLOAD.
*/ */
case 702: case 702:
{ {
if (code_seen('C')) { // TODO: Implement U parameter
if(MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); //! if "C" unload current filament; if mmu is not present no action is performed
} if (code_seen('Z'))
else { {
if(MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); //! unload current filament float z_target = code_value();
else unload_filament(); raise_z_above(z_target, false);
} } else {
} raise_z_above(MIN_Z_FOR_UNLOAD, false);
break; }
if (MMU2::mmu2.Enabled())
{
MMU2::mmu2.unload();
} else {
unload_filament();
}
}
break;
/*! /*!
### M704 - Load to MMU ### M704 - Load to MMU