feat: Add support for switching to previously used bluetooth profile
This is a PR to make it possible to switch to the index of the previously used profile. This is a feature I will need for my project (swapping between RPi and computer)
There are previous PRs offering this functionality, but they have comments that they didn't bother to fix, so I did it in this one.
I switched LAST_DEV to PRV_DEV as I think LAST could be misinterpreted to mean the last index of the list of profiles.
I also didn't add flash save for the previous_profile as exists for the active_profile. Instead I added initialize to 0, so each time you boot, the PRV_DEV will take you to index 0 for the first time, unless you switch profiles before pressing it with the other profile options. Maybe it should be saved but I thought it was a bit overkill for this, tell me if you want me to add this feature.
Fixes #767
Regarding saving to memory, I think if you could get it to save both the current and previous profiles in a single write action to the same block, then it would be worth doing so. I'm not sure if that's possible, though, not looked into it.
On going through this again, could probably add a test for this.
This PR has been automatically marked as stale because it has not had activity in 10 months. It will be closed in 14 days if no further activity occurs. Feel free to give a status update or re-open when it has been rebased and is ready for review (again). Thanks!