diff options
author | gornekich <44112859+gornekich@users.noreply.github.com> | 2021-04-07 10:37:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 10:37:10 +0300 |
commit | 8ce5af1be22613fe300b03f6d26501b09dc7088e (patch) | |
tree | 0696fa64e0b86fedecb719a2c9a95b2c4c5593a2 /applications/ibutton | |
parent | 5cd73ac97b1bb33e48520e5c836b5095dbee5b51 (diff) |
[FL-1050] SD card error view (#399)
* sd-filesystem: add check error to api
* sd-filesystem: call error check from file select
* ibutton: process sd card error on key saving
Co-authored-by: rusdacent <57439765+rusdacent@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
Diffstat (limited to 'applications/ibutton')
-rw-r--r-- | applications/ibutton/scene/ibutton-scene-save-name.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/applications/ibutton/scene/ibutton-scene-save-name.cpp b/applications/ibutton/scene/ibutton-scene-save-name.cpp index e84cf2f2..f7bbe4ed 100644 --- a/applications/ibutton/scene/ibutton-scene-save-name.cpp +++ b/applications/ibutton/scene/ibutton-scene-save-name.cpp @@ -41,12 +41,16 @@ bool iButtonSceneSaveName::on_event(iButtonApp* app, iButtonEvent* event) { app->get_fs_api()->common.mkdir("ibutton"); bool res = app->get_fs_api()->file.open( &key_file, string_get_cstr(key_file_name), FSAM_WRITE, FSOM_CREATE_ALWAYS); + // TODO process file system errors from file system service if(res) { res = app->get_fs_api()->file.write(&key_file, key_data, IBUTTON_KEY_SIZE + 1); res = app->get_fs_api()->file.close(&key_file); + app->switch_to_next_scene(iButtonApp::Scene::SceneSaveSuccess); + } else { + app->get_sd_ex_api()->check_error(app->get_sd_ex_api()->context); + app->switch_to_next_scene(iButtonApp::Scene::SceneStart); } string_clear(key_file_name); - app->switch_to_next_scene(iButtonApp::Scene::SceneSaveSuccess); consumed = true; } |