PN532 SAM_configuration powermode updates - #41
Merged
Merged
Conversation
Test Results136 tests 136 ✅ 19s ⏱️ Results for commit 1d71e53. |
This branch was previously deployed
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 pull request improves the robustness and reliability of the PN532 RFID reader integration by adding automatic recovery from I2C errors, enhancing the stub for development, and refactoring initialization logic. It also includes minor test code updates.
PN532 RFID Reader Reliability Improvements:
_init_pn532function, which returns a hardware instance or a stub on failure, and ensures the reader is always kept in Normal Mode by shadowingpower_downwithFalseto prevent accidental sleep.check_rfidloop to track consecutive I2C errors and automatically reinitialize the PN532 after five consecutive failures, improving recovery from hardware stalls without requiring a device reboot. Heartbeat logging and error streak tracking were also added.Development and Testing Improvements:
PN532Stubclass to match the hardware interface more closely by shadowingpower_down, adding type annotations, and improving method signatures for better testability and consistency.ingest_action_log_filefrommetrics_storagein preparation for further test enhancements.