From afb8e93b139d13e851126962ec31029f5663fbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sun, 16 May 2021 19:57:08 +0200 Subject: [PATCH] Rework function for finding temperature profiles to be able to search for any pattern --- stm-firmware/ui/gui.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stm-firmware/ui/gui.c b/stm-firmware/ui/gui.c index 293a2ed..aa98ae8 100644 --- a/stm-firmware/ui/gui.c +++ b/stm-firmware/ui/gui.c @@ -382,7 +382,7 @@ static void delete_file_list_entry(void *obj) free(obj); } -static SlList *load_temp_profile_list_from_sdcard(int *error) +static SlList *load_file_list_from_sdcard(int *error, const char *file_pattern) { DIR directory; FILINFO finfo; @@ -392,7 +392,7 @@ static SlList *load_temp_profile_list_from_sdcard(int *error) char *name; /* find the frist file */ - fres = f_findfirst(&directory, &finfo, "/", "*.tpr"); + fres = f_findfirst(&directory, &finfo, "/", file_pattern); while (fres == FR_OK && finfo.fname[0]) { name = malloc(strlen(finfo.fname) + 1); strcpy(name, finfo.fname); @@ -485,7 +485,7 @@ static void gui_menu_temp_profile_select(struct lcd_menu *menu, enum menu_entry_ sl_list_free_full(file_list, delete_file_list_entry); } - file_list = load_temp_profile_list_from_sdcard(&file_error); + file_list = load_file_list_from_sdcard(&file_error, "*.tpr"); currently_selected = 0u; profile_ret_val = PL_RET_SUCCESS;