Pass file name to export function

This commit is contained in:
vovodroid 2024-05-28 20:33:42 +03:00
parent 75e78ef20d
commit 81d7e39660
3 changed files with 7 additions and 3 deletions

View file

@ -1960,8 +1960,8 @@ uint8_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t ind,
}
#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

View file

@ -784,6 +784,10 @@ public:
static void export_settings();
#endif
#if ENABLED(EXPORT_SETTINGS)
static void export_settings(const char* filename);
#endif
//
// Special handling if a move is underway
//

View file

@ -799,7 +799,7 @@ void menu_advanced_settings() {
#endif
#if ENABLED(EXPORT_SETTINGS)
ACTION_ITEM(MSG_EXPORT_SETTINGS, ui.export_settings);
ACTION_ITEM(MSG_EXPORT_SETTINGS, []{ui.export_settings("M503.GC");});
#endif
END_MENU();