-
-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Sound #80
base: main
Are you sure you want to change the base?
Improve Sound #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In relation to commit 2287720
Only now I do recognized that beside the HighLevel-Mode also the HighLevel-SubMode is available in ..._high_level_state.current_mode
.
I like to use it for some more sound stuff identification, but didn't like to do the Mode-Masking and SubMode-Shifting again and again.
So I built this simple class for easier handling of the HighLevel-Modes and SubModes.
What I'm undecided is:
- My decision for a Class or if I should better build it as/with template functions?
- The location in datatypes.h. Should it better go into a HigheLevelState.hpp file?
How're your thoughts?
Finished all new sound capabilities (by the use of the HL-State-SubModes), changes and ideas. |
Think I'm done 🤔 Background-Sounds are optional now and default to "off"! Completely changed DFPlayer, auto-play- quirk and SD-Card-Structure (origin/new) detection. Also changed some code stuff which was ugly before. Made about 367 tests on my Desktop with original as well as DFPlayer-Clones, with old and new SD-Card structure (because of my changed detection code). This PR ClemensElflein/open_mower_ros#166 is also required for getting background-sound option in mower_config Website/Docs changes are here: ClemensElflein/openmower.de#40 |
Think this is how it can be done.
This PR mainly:
SD-Card Structure Problem (old/new sound implementation):
I assumed that >90% of the installations in the wild, will have the original DFRobot DFPlayer with the old SD-Card-Structure installed.
Because DFRobot's DFPlayer has the quirk to auto-play the first sound in SD-Cards root, after a reset(), I detect an old SD-Card-Structure in that way, that if there's an auto-played sound with a specific length (shorter than the one of the new SD-Card-Structure) then it's identified as "old SD-Card-Structure". For sure, this works only for those who have an DFRobot DFPlayer.
This (shall) result in the following behavior (tested with a couple of DFPlayer and SD-Cards):
Overcurrent problem on 3.3V (Pico) line
All current OM installation (with sound) already play "Hi", krk, "Hi, I'm Steve ..." and we haven't heard of died Pico (VREG) till now.
So this sound PR also stop (by default) after "Hi, I'm Steve ...", except it got compiled with
DFPIS5V
(already added to CI firmware build)For sure this doubles our firmware binaries :-/ But does it matter?
firmware.zip