Skip to content

Commit

Permalink
Pass file name to export function
Browse files Browse the repository at this point in the history
  • Loading branch information
vovodroid committed May 28, 2024
1 parent b869862 commit 342388e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1883,8 +1883,8 @@ void MarlinUI::host_notify(const char * const cstr) {
}
#endif
#if ENABLED(EXPORT_SETTINGS)
void MarlinUI::export_settings() {
if (sr_file_open("M503.gc")) {
void MarlinUI::export_settings(const char* filename) {
if (sr_file_open(filename)) {
settings.report(true);
completion_feedback(sr_file_close() && sr_write_res != -1);
} else
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/lcd/marlinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,10 @@ class MarlinUI {
static void export_settings();
#endif

#if ENABLED(EXPORT_SETTINGS)
static void export_settings(const char* filename);
#endif

//
// Special handling if a move is underway
//
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,10 @@ void menu_advanced_settings() {
ACTION_ITEM(MSG_EXPORT_SETTINGS, ui.export_settings);
#endif

#if ENABLED(EXPORT_SETTINGS)
ACTION_ITEM(MSG_EXPORT_SETTINGS, []{ui.export_settings("M503.GC");});
#endif

END_MENU();
}

Expand Down

0 comments on commit 342388e

Please sign in to comment.