Add File Naming setting for more detailed naming (#3002)
* added filename mode setting * added furi_flag checks for when filename_mode is set * changed naming for ibutton, lfrfid and subghz * requested changes from PR * Lib: gather all naming bits and pieces under name generator module. Properly bump api version. FuriHal: fix RTC flag enum. * PR requested changes * bug fix for arg type * added functionality for other application scenes * Lib: cleanup name generator API, simplify usage. Sync API symbols. * Lib: proper size type in name_generator. Cleanup. * FuriHal: cleanup rtc api usage across firmware Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -153,6 +153,21 @@ static void sleep_method_changed(VariableItem* item) {
|
||||
}
|
||||
}
|
||||
|
||||
const char* const filename_scheme[] = {
|
||||
"Default",
|
||||
"Detailed",
|
||||
};
|
||||
|
||||
static void filename_scheme_changed(VariableItem* item) {
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
variable_item_set_current_value_text(item, filename_scheme[index]);
|
||||
if(index) {
|
||||
furi_hal_rtc_set_flag(FuriHalRtcFlagDetailedFilename);
|
||||
} else {
|
||||
furi_hal_rtc_reset_flag(FuriHalRtcFlagDetailedFilename);
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t system_settings_exit(void* context) {
|
||||
UNUSED(context);
|
||||
return VIEW_NONE;
|
||||
@@ -236,6 +251,12 @@ SystemSettings* system_settings_alloc() {
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, sleep_method[value_index]);
|
||||
|
||||
item = variable_item_list_add(
|
||||
app->var_item_list, "File Naming", COUNT_OF(filename_scheme), filename_scheme_changed, app);
|
||||
value_index = furi_hal_rtc_is_flag_set(FuriHalRtcFlagDetailedFilename) ? 1 : 0;
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, filename_scheme[value_index]);
|
||||
|
||||
view_set_previous_callback(
|
||||
variable_item_list_get_view(app->var_item_list), system_settings_exit);
|
||||
view_dispatcher_add_view(
|
||||
|
||||
Reference in New Issue
Block a user