Skip to content

Commit

Permalink
Fix Tile Tag Saving
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewKuKanich committed Apr 27, 2024
1 parent a31cd14 commit 9e15217
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions applications/system/findmy/findmy_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,16 @@ bool findmy_state_load(FindMyState* out_state) {
if(!flipper_format_read_uint32(file, "transmit_power", &tmp, 1)) break;
state.transmit_power = tmp;

if(!flipper_format_read_uint32(file, "tag_type", &tmp, 1)) break;
state.tag_type = tmp;
FURI_LOG_E("tag_type tmp", "%ld", tmp);

if(!flipper_format_read_bool(file, "show_mac", &state.show_mac, 1)) {
// Support migrating from old config
state.show_mac = false;
flipper_format_rewind(file);
}

if(!flipper_format_read_uint32(file, "tag_type", &tmp, 1)) {
// Support migrating from old config
tmp = FindMyTypeApple;
flipper_format_rewind(file);
}
state.tag_type = tmp;

if(!flipper_format_read_hex(file, "mac", state.mac, sizeof(state.mac))) break;

if(!flipper_format_read_hex(
Expand Down Expand Up @@ -162,6 +159,7 @@ void findmy_state_save(FindMyState* state) {
if(!flipper_format_write_uint32(file, "transmit_power", &tmp, 1)) break;

tmp = state->tag_type;
FURI_LOG_E("tag_type at save", "%ld", tmp);
if(!flipper_format_write_uint32(file, "tag_type", &tmp, 1)) break;

if(!flipper_format_write_bool(file, "show_mac", &state->show_mac, 1)) break;
Expand Down

0 comments on commit 9e15217

Please sign in to comment.