Skip to content

Commit 047a345

Browse files
authored
Merge pull request Next-Flip#74 from LeeroysHub/pr_load_from_browser
Load PSF from Parameter (FW Integration in Favorites and Browser)
2 parents fbf2f62 + abeeefd commit 047a345

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

protopirate_app.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "helpers/protopirate_settings.h"
88
#include "helpers/protopirate_storage.h"
99
#include "protocols/keys.h"
10+
#include <string.h>
1011

1112
#define TAG "ProtoPirateApp"
1213

@@ -206,9 +207,6 @@ ProtoPirateApp* protopirate_app_alloc() {
206207
subghz_worker_set_pair_callback(
207208
app->txrx->worker, (SubGhzWorkerPairCallback)subghz_receiver_decode);
208209
subghz_worker_set_context(app->txrx->worker, app->txrx->receiver);
209-
210-
scene_manager_next_scene(app->scene_manager, ProtoPirateSceneStart);
211-
212210
return app;
213211
}
214212

@@ -311,13 +309,19 @@ void protopirate_app_free(ProtoPirateApp* app) {
311309
free(app);
312310
}
313311

314-
int32_t protopirate_app(void* p) {
315-
UNUSED(p);
316-
312+
int32_t protopirate_app(char* p) {
317313
furi_hal_power_suppress_charge_enter();
318314

319315
ProtoPirateApp* protopirate_app = protopirate_app_alloc();
320316

317+
//Handle Command line PSF that may have been passed to us, load in Saved Info Scene.
318+
bool load_saved = (p && strlen(p));
319+
if(load_saved) protopirate_app->loaded_file_path = furi_string_alloc_set(p);
320+
321+
scene_manager_next_scene(
322+
protopirate_app->scene_manager,
323+
(load_saved) ? ProtoPirateSceneSavedInfo : ProtoPirateSceneStart);
324+
321325
view_dispatcher_run(protopirate_app->view_dispatcher);
322326

323327
protopirate_app_free(protopirate_app);

0 commit comments

Comments
 (0)