feat: Add support for switching to previously used bluetooth profile #2497
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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