Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
File loading fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyweiss committed Feb 3, 2023
1 parent 5785c75 commit 17c8e3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ For those desiring better TX than the internal RFID coil can offer, one can buil

## TODO
Known bugs:
- [ ] File format issues when Track 2 data exists but Track 1 is left empty; doesn't seem to be setting the Track 2 field with anything (doesn't overwrite existing data). However, `flipper_format_read_string()` doesn't seem to return `false`. Is the bug in my code, or with `flipper_format`?
- [ ] Review how it's done in [unirfremix (Sub-GHz Remote)](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/applications/main/unirfremix/unirfremix_app.c), as IIRC that can handle empty keys, despite using the `flipper_format` lib for parsing.
- [X] File format issues when Track 2 data exists but Track 1 is left empty; doesn't seem to be setting the Track 2 field with anything (doesn't overwrite existing data). However, `flipper_format_read_string()` doesn't seem to return `false`. Is the bug in my code, or with `flipper_format`?
- [X] Review how it's done in [unirfremix (Sub-GHz Remote)](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/applications/main/unirfremix/unirfremix_app.c), as IIRC that can handle empty keys, despite using the `flipper_format` lib for parsing.
- [ ] Attempting to play a track that doesn't have data results in a crash (as one might expect). Need to lock out users from selecting empty tracks in the config menu or do better error handling
- [ ] Custom text input scene with expanded characterset (Add Manually) has odd behavior when navigating the keys near the numpad

Emulation:
- [ ] Validate arha's bitmap changes, transition over to it fully
- [ ] Test piezo TX (prelim tests promising)
- [X] Test piezo TX (prelim tests promising)
- [ ] General code cleanup
- [ ] Reverse track precompute & replay (should be simple with new bitmap approach; just iterate through bytes backwards, bits forwards?)
- [ ] Parameter tuning, find best defaults, troubleshoot improperly parsed TX
Expand Down
4 changes: 3 additions & 1 deletion mag_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ static bool mag_device_load_data(MagDevice* mag_dev, FuriString* path, bool show
furi_string_printf(temp_str, "Track %d", i + 1);
if(!flipper_format_read_string(
file, furi_string_get_cstr(temp_str), mag_dev->dev_data.track[i].str)) {
FURI_LOG_D(TAG, "Could not read track %d data", i + 1);

// TODO: smarter load handling now that it is acceptible for some tracks to be empty
data_read = false;
break;
}
}

Expand Down

0 comments on commit 17c8e3b

Please sign in to comment.