Selaa lähdekoodia

Cross Remote: Make app dir on open

Willy-JL 11 kuukautta sitten
vanhempi
commit
ff4dbdaafa
2 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 1 1
      cross_remote/helpers/xremote_storage.c
  2. 4 0
      cross_remote/xremote.c

+ 1 - 1
cross_remote/helpers/xremote_storage.c

@@ -30,7 +30,7 @@ void xremote_save_settings(void* context) {
     }
 
     // Open File, create if not exists
-    if(!storage_common_stat(storage, XREMOTE_SETTINGS_SAVE_PATH, NULL) == FSE_OK) {
+    if(storage_common_stat(storage, XREMOTE_SETTINGS_SAVE_PATH, NULL) != FSE_OK) {
         FURI_LOG_D(
             TAG, "Config file %s is not found. Will create new.", XREMOTE_SETTINGS_SAVE_PATH);
         if(storage_common_stat(storage, CONFIG_FILE_DIRECTORY_PATH, NULL) == FSE_NOT_EXIST) {

+ 4 - 0
cross_remote/xremote.c

@@ -207,6 +207,10 @@ int32_t xremote_app(void* p) {
 
     furi_hal_power_suppress_charge_enter();
 
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    storage_common_mkdir(storage, XREMOTE_APP_FOLDER);
+    furi_record_close(RECORD_STORAGE);
+
     if(strcmp(subghz_txrx_radio_device_get_name(app->subghz->txrx), "cc1101_ext") != 0) {
         InfraredSettings settings = {0};
         infrared_settings_load(&settings);