Skip to content

Commit

Permalink
🐛 Fix minimal M115, Cap:PROGRESS:0 (MarlinFirmware#25769)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
plampix and thinkyhead authored May 2, 2023
1 parent 137ea43 commit 21ea9bf
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions Marlin/src/gcode/host/M115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,15 @@
//#define MINIMAL_CAP_LINES // Don't even mention the disabled capabilities

#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
#if ENABLED(MINIMAL_CAP_LINES)
#define cap_line(S,C) if (C) _cap_line(S)
static void _cap_line(FSTR_P const name) {
SERIAL_ECHOPGM("Cap:");
SERIAL_ECHOF(name);
SERIAL_ECHOLNPGM(":1");
}
#else
#define cap_line(V...) _cap_line(V)
static void _cap_line(FSTR_P const name, bool ena=false) {
SERIAL_ECHOPGM("Cap:");
SERIAL_ECHOF(name);
inline void cap_line(FSTR_P const name, const bool ena=true) {
#if ENABLED(MINIMAL_CAP_LINES)
if (ena) SERIAL_ECHOLNPGM("Cap:", name, ":1");
#else
SERIAL_ECHOPGM("Cap:", name);
SERIAL_CHAR(':', '0' + ena);
SERIAL_EOL();
}
#endif
#endif
}
#endif

/**
Expand Down Expand Up @@ -100,10 +93,10 @@ void GcodeSuite::M115() {
serial_index_t port = queue.ring_buffer.command_port();

// PAREN_COMMENTS
TERN_(PAREN_COMMENTS, cap_line(F("PAREN_COMMENTS"), true));
TERN_(PAREN_COMMENTS, cap_line(F("PAREN_COMMENTS")));

// QUOTED_STRINGS
TERN_(GCODE_QUOTED_STRINGS, cap_line(F("QUOTED_STRINGS"), true));
TERN_(GCODE_QUOTED_STRINGS, cap_line(F("QUOTED_STRINGS")));

// SERIAL_XON_XOFF
cap_line(F("SERIAL_XON_XOFF"), ENABLED(SERIAL_XON_XOFF));
Expand All @@ -124,10 +117,10 @@ void GcodeSuite::M115() {
cap_line(F("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT_TEMPERATURES));

// PROGRESS (M530 S L, M531 <file>, M532 X L)
cap_line(F("PROGRESS"));
cap_line(F("PROGRESS"), false);

// Print Job timer M75, M76, M77
cap_line(F("PRINT_JOB"), true);
cap_line(F("PRINT_JOB"));

// AUTOLEVEL (G29)
cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
Expand All @@ -153,9 +146,9 @@ void GcodeSuite::M115() {

// SPINDLE AND LASER CONTROL (M3, M4, M5)
#if ENABLED(SPINDLE_FEATURE)
cap_line(F("SPINDLE"), true);
cap_line(F("SPINDLE"));
#elif ENABLED(LASER_FEATURE)
cap_line(F("LASER"), true);
cap_line(F("LASER"));
#endif

// EMERGENCY_PARSER (M108, M112, M410, M876)
Expand Down

0 comments on commit 21ea9bf

Please sign in to comment.