Repository navigation
cyberpunkunicorn-os 0.1.5: read every PN532 answer before the next command - #19
Merged
Merged
Conversation
…mmand Daniel's 0.1.4 log: the PN532 answered GetFirmwareVersion, then every card search ended 'no ack'. startReader() used Adafruit's setPassiveActivationRetries(), which never reads the chip's answer, and SAMConfig(), which reads it without waiting. The answer left in the chip was read in place of the next command's ACK, so every poll looked unanswered. Both setup commands now go through command(), which waits for and checks the answer, and the setup result is logged. A card search that runs past its wait is cancelled with an ACK frame so its late answer can't do the same. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Aw32AU4vVqCSEoNA5aP3U
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 fixes the bug behind the card reader looking dead.
Daniel's 0.1.4 log showed
PN532 firmware answered (0x32010607), and then every card search ended in "no ack". InstartReader(), Adafruit'ssetPassiveActivationRetries()never reads the chip's answer, andSAMConfig()reads it without waiting for it. The answer left in the chip was then read in place of the next command's ACK, so every poll looked unanswered.Changes:
command()sends a command, waits for the answer, and checks it (D5, CMD+1). SAMConfiguration and RFConfiguration (MaxRetries 5) now go through it, and the result is logged as[freq] PN532 setup: SAM ..., retries ....PlatformIO can't build in the cloud session, so this PR's CI build is the compile check. It isn't hardware-tested: Daniel will install it from the Update tab.
Generated by Claude Code