Skip to content

Commit

Permalink
Add en- and disable MMU to M709
Browse files Browse the repository at this point in the history
Add X42 to erase the MMU eeprom
  • Loading branch information
3d-gussner committed Oct 30, 2023
1 parent 3ffe7bf commit a356209
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8581,24 +8581,44 @@ SERIAL_PROTOCOLPGM("\n\n");
} break;

/*!
### M709 - MMU reset <a href="https://reprap.org/wiki/G-code#M709:_MMU_reset">M709: MMU reset</a>
The MK3S cannot not power off the MMU, for that reason the functionality is not supported.
### M709 - MMU power & reset <a href="https://reprap.org/wiki/G-code#M709:_MMU_power_&_reset">M709: MMU power & reset</a>
The MK3S cannot not power off the MMU, but we can en- and disable the MMU.
#### Usage
M709 [ X ]
M709 [ S | X ]
#### Parameters
- `X` - Reset MMU (0:soft reset | 1:hardware reset)
- `X` - Reset MMU (0:soft reset | 1:hardware reset | 42: erease MMU eeprom)
- `S` - En-/disable the MMU (0:off | 1:on)
#### Example
M709 X0 - issue an X0 command via communication into the MMU (soft reset)
M709 X1 - toggle the MMU's reset pin (hardware reset)
M709 S1 - enable MMU
M709 S0 - disable MMU
M709 - Serial message if en- or disabled
*/
case 709:
{
if (code_seen('S'))
{
switch (code_value_uint8())
{
case 0:
MMU2::mmu2.Stop();
break;
case 1:
MMU2::mmu2.Start();
break;
default:
break;
}
}
if (MMU2::mmu2.Enabled() && code_seen('X'))
{
switch (code_value_uint8())
Expand All @@ -8609,10 +8629,14 @@ SERIAL_PROTOCOLPGM("\n\n");
case 1:
MMU2::mmu2.Reset(MMU2::MMU2::ResetPin);
break;
case 42:
MMU2::mmu2.Reset(MMU2::MMU2::EraseEEPROM);
break;
default:
break;
}
}
printf_P(_n("MMU state:%d\n"), MMU2::mmu2.Enabled());
}
break;

Expand Down

0 comments on commit a356209

Please sign in to comment.