Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7353ea2e5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| delay(300); | ||
|
|
||
| if (!dfPlayer.begin(dfSerial, true, true)) { | ||
| if (!dfPlayer.begin(dfSerial, false, true)) { |
There was a problem hiding this comment.
Re-enable ACK after the DFPlayer init workaround
Passing false here changes more than the startup check: in DFRobotDFPlayerMini, begin(..., false, ...) disables ACK mode on the dfPlayer object for all later commands. In this sketch that means outputDevice() in initDFPlayer() and the volume()/play()/stop() sequence in runTest_Speaker() no longer wait for the module's command ACKs and instead run with only the library's fixed 10 ms pacing. On slower DFPlayers or SD cards this can turn tests 5/6 into intermittent false FAILs even after init succeeds, so the workaround should not leave ACKs disabled for the rest of the session.
Useful? React with 👍 / 👎.
Links
What & Why
isACK=truetoisACK=falsein
dfPlayer.begin()to prevent timing race where unsolicited SD card statuspackets cause
begin()to miss the ACK and return false on working hardware.Validation / How to Verify
4— should reportPASSand notDFPlayer not detected.5and6— SD file count should be > 0 and speaker should play.Artifacts (attach if relevant)
DFPlayer detected and respondingChecklist