From b00f8fad8bc0176494fda69657dd27c53c7ef1b3 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Thu, 3 Aug 2023 04:25:30 +0200 Subject: [PATCH] Tweak mass storage creator sizes --- applications/external/mass_storage/mass_storage_app.c | 2 +- .../external/mass_storage/mass_storage_app_i.h | 2 -- .../scenes/mass_storage_scene_create_image.c | 11 ++++------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/applications/external/mass_storage/mass_storage_app.c b/applications/external/mass_storage/mass_storage_app.c index 7e711ee85..53cc92bb5 100644 --- a/applications/external/mass_storage/mass_storage_app.c +++ b/applications/external/mass_storage/mass_storage_app.c @@ -31,7 +31,7 @@ MassStorageApp* mass_storage_app_alloc(char* arg) { furi_string_set_str(app->file_path, MASS_STORAGE_APP_PATH_FOLDER); } - app->create_image_size = 100; + app->create_image_size = 128; app->create_size_unit = SizeUnitMb; app->gui = furi_record_open(RECORD_GUI); diff --git a/applications/external/mass_storage/mass_storage_app_i.h b/applications/external/mass_storage/mass_storage_app_i.h index 7601dce8c..ca40df4f0 100644 --- a/applications/external/mass_storage/mass_storage_app_i.h +++ b/applications/external/mass_storage/mass_storage_app_i.h @@ -22,8 +22,6 @@ #define MASS_STORAGE_FILE_NAME_LEN 40 typedef enum { - SizeUnitBytes, - SizeUnitKb, SizeUnitMb, SizeUnitGb, SizeUnitCount, diff --git a/applications/external/mass_storage/scenes/mass_storage_scene_create_image.c b/applications/external/mass_storage/scenes/mass_storage_scene_create_image.c index 2e27fe601..861a9550d 100644 --- a/applications/external/mass_storage/scenes/mass_storage_scene_create_image.c +++ b/applications/external/mass_storage/scenes/mass_storage_scene_create_image.c @@ -13,8 +13,7 @@ void mass_storage_scene_create_image_var_item_list_callback(void* context, uint3 view_dispatcher_send_custom_event(app->view_dispatcher, index); } -const uint32_t image_size_values[] = {1, 2, 4, 8, 12, 16, 20, 25, 30, 35, 40, - 45, 50, 69, 75, 100, 150, 200, 250, 500, 750}; +const uint32_t image_size_values[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; static void mass_storage_scene_create_image_image_size_changed(VariableItem* item) { MassStorageApp* app = variable_item_get_context(item); app->create_image_size = image_size_values[variable_item_get_current_value_index(item)]; @@ -24,10 +23,8 @@ static void mass_storage_scene_create_image_image_size_changed(VariableItem* ite } const char* const size_unit_names[] = { - [SizeUnitBytes] = "Bytes", - [SizeUnitKb] = "Kb", - [SizeUnitMb] = "Mb", - [SizeUnitGb] = "Gb", + [SizeUnitMb] = "MB", + [SizeUnitGb] = "GB", }; static void mass_storage_scene_create_image_size_unit_changed(VariableItem* item) { MassStorageApp* app = variable_item_get_context(item); @@ -127,7 +124,7 @@ bool mass_storage_scene_create_image_on_event(void* context, SceneManagerEvent e if(storage_file_open( app->file, furi_string_get_cstr(app->file_path), FSAM_WRITE, FSOM_CREATE_NEW)) { uint64_t size = app->create_image_size; - for(size_t i = app->create_size_unit; i > 0; i--) size *= 1024; + for(size_t i = app->create_size_unit + 2; i > 0; i--) size *= 1024; if(!storage_file_expand(app->file, size)) { error = "Can't allocate data"; }