gpstar81 / GPStar-proton-pack

GPStar Proton Pack and Neutrona Wand
https://www.gpstartechnologies.com
GNU General Public License v3.0
37 stars 8 forks source link

Fix music check #304

Closed nomakewan closed 4 months ago

nomakewan commented 4 months ago

Fixes music check failing for WAV Trigger as of 5.0.3 due to piggybacking of GPStar Audio only function.

To be more precise, "sysinfoRcvd" was a boolean variable that was being set to true by both the WAV Trigger and GPStar Audio (albeit via two completely different serial messages). When fixing the previous music bug for V5.0.0 (that a corrupt SD card or improper response from the WAV Trigger can lead to corrupt values for music count), I abused the fact that this variable was set by both and called the GPStar Audio function to get the return value (since it was the only function which returned it).

In V5.0.3 I fixed the bug where a WAV Trigger could incorrectly be identified as a GPStar Audio board by making sure that boolean variable would only be set by a GPStar Audio board. This worked, but had the unintended side effect that now the check for the WAV Trigger's music count which was using the GPStar Audio return value would always fail (because it is not a GPStar Audio). I did not notice because the symptoms were identical to what happened with my previous two failed microSD cards--music stopped working after adding new files to the cards. So I (incorrectly) assumed that my third SD card had just failed.

After a user report I realized the issue. Now there are separate boolean variables for the WAV Trigger and GPStar Audio, and separate functions to return the value of this variable. I have confirmed that this restored music playback on my WAV Trigger setup with my current microSD card.