Skip to content

Commit

Permalink
FindMy: Resume at system boot if enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Mar 9, 2024
1 parent 4c80a50 commit a5ae139
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions applications/system/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ App(
"updater_app",
"storage_move_to_sd",
"js_app",
"findmy_startup",
# "archive",
],
)
9 changes: 9 additions & 0 deletions applications/system/findmy/application.fam
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ App(
fap_version="1.0",
fap_description="BLE FindMy Location Beacon",
)

App(
appid="findmy_startup",
targets=["f7"],
apptype=FlipperAppType.STARTUP,
entry_point="findmy_startup",
sources=["findmy_startup.c", "findmy_state.c"],
order=1000,
)
11 changes: 11 additions & 0 deletions applications/system/findmy/findmy_startup.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "findmy_state.h"
#include <furi_hal.h>

void findmy_startup() {
if(!furi_hal_is_normal_boot()) return;

FindMyState state;
if(findmy_state_load(&state)) {
findmy_state_apply(&state);
}
}

0 comments on commit a5ae139

Please sign in to comment.