* allow for all files to unset archive bit, except Nintendo dir
* don't recalculate path length with every file
* use strlen instead of a loop
* negating the if statement to reduce conditional context
* move an operation to the beginning of the loop so we don't have to have it twice
* combining some lines and removing a var for efficiency
Based on tests they are not faster, even though the raw sleeps have less instuctions.
But having them call get_tmr breaks important logic.
Make both raw to avoid any future problems.
This will fix everything that uses a timer (or sleep).
Without this any function like eMMC/SD read/write/verify, TSEC/SE, etc can break when the time reaches the max value of the u32 microsecond timer (71minutes).
This fixes every possible breakage, including backup and restore (read/write/verify errors) that takes a lot of time.
The new max before a timer reset is now 48 days (the old one was 71 minutes)
The real reason for the "battery de-sync" is a misconfig of MAX77620 low battery monitor.
So there's no real battery battery de-sync.
Thanks @natinusala and @perillamint for finding this
When the commit with the configuration will be a available, these 3 options will exist:
- Disable verification
- Sparse verification (Fast)
- Full (Slow)
Sparse will take approx 8 minutes for rawnand.bin and Full will take 4.5 hours.
* Make FatFS thread safe via malloc and remove alloca.
* Fix memory leak from emmc gpt parsing
* Always unmount SD card in menu and when launching
* Use folders for Backup/Dump/Restore operations
* Add error report for some important f_opens
* Don't let partial dumping if backup chosen is not GPP or USER.
* [INI] Fix memory leaks + other fixes
* Add ini_free
* check and return if NULL pointer in free()
* Add button check with timeout
* Fix a bug in menu rendering that tries to parse a string without existing
* Change initial cnt value to max (fixes menus with first entry not a selectable entry)
* Some & ? clarifications
* [INI] Add get selected boot cfg
- This allows to free ini as we launch the firmware and have the lowest mem leak
* [INI] Rename ini section clone/free functions