Improve/fix D23 for M2.5/S printers

- Move D23 into it's own function inside Dcodes
- Correctly include a break in the switch statement
- Show the dumper status (enabled/disabled) after toggling
- Allow to generate an immediate dump via g-code using D23 E for
  symmetry with D20 E
This commit is contained in:
Yuri D'Elia 2021-06-24 17:35:55 +02:00 committed by DRracer
parent 380e34d481
commit 56e531d40a
3 changed files with 18 additions and 3 deletions
Firmware

View file

@ -974,6 +974,18 @@ void dcode_22()
bool emergency_serial_dump = false;
void dcode_23()
{
if(code_seen('E'))
serial_dump_and_reset(dump_crash_reason::manual);
else
{
emergency_serial_dump = !code_seen('R');
SERIAL_ECHOPGM("serial dump ");
SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled"));
}
}
void __attribute__((noinline)) serial_dump_and_reset(dump_crash_reason reason)
{
uint16_t sp;