Skip to content

Conversation

@ellensp
Copy link
Contributor

@ellensp ellensp commented Oct 15, 2025

Description

While playing with GCODE_MACROS I noticed there was no way to see the currently set macros. So I added a
optional GCODE_MACROS_REPORT which adds macro reporting to M503 settings display.

eg

M810 Hello world
M812 Testing123
M814 Marlin rocks!
M503
...
echo:; GCODE Macros:
echo:  M810 Hello world
echo:  M811 <empty>
echo:  M812 Testing123
echo:  M813 <empty>
echo:  M814 Marlin rocks!
ok

While I was there I added a second option GCODE_MACROS_EEPROM so the macros are saved and loaded from eeprom if you enable it

Requirements

GCODE_MACROS
Optionally GCODE_MACROS_REPORT
Optionally EEPROM_SETTINGS with GCODE_MACROS_IN_EEPROM

Benefits

Improvements to GCODE_MACROS

Related Issues

Was helping out with https://reprap.org/forum/read.php?415,897251,897252

@thinkyhead
Copy link
Member

The reason that this feature never had saving to EEPROM is that we considered it a bad idea to separate the invocation of "anonymous" macros from the G-code that defines them. Macros are meant to be used as shorthand to make the G-code a little bit smaller when something is done repeatedly and frequently. As such they are also meant to be defined in the G-code file so that there is no mixup when inevitably macros get moved around or deleted.

There are better concepts for defining reusable macros in G-code, specifically by having named macros, where it is more clear what the macro is meant to do when invoked, and it is more obvious what code is likely missing when a macro gets lost. It may also be easier to remember a name than the number of some macro defined in the past.

@ellensp
Copy link
Contributor Author

ellensp commented Oct 19, 2025

Its optional. Surely it should be up to the user how they want to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants