lora: Fix IRQ bit mask for sx126x#1113
Open
maholli wants to merge 1 commit into
Open
Conversation
Fixes micropython#1112 which causes corrupt packets to silently be passed as valid by the driver.
projectgus
requested changes
May 20, 2026
Contributor
projectgus
left a comment
There was a problem hiding this comment.
Hi @maholli, sorry it took me a little while to get back to this. Thanks for very clear description of the problem and the fix.
I have a request about the code comment surrounding this change, and also please edit micropython/lora/lora-sx126x/manifest.py and bump the bugfix version of this package so mip will update it.
Thanks again!
Comment on lines
225
to
232
| # If DIO1 is set, mask in just the IRQs that the driver may need to be | ||
| # interrupted by. This is important because otherwise an unrelated IRQ | ||
| # can trigger the ISR and may not be reset by the driver, leaving DIO1 high. | ||
| # | ||
| # If DIO1 is not set, all IRQs can stay masked which is the power-on state. | ||
| if dio1: | ||
| # Note: we set both Irq mask and DIO1 mask to the same value, which is redundant | ||
| # (one could be 0xFFFF) but may save a few bytes of bytecode. |
Contributor
There was a problem hiding this comment.
These comments are for the old (broken) code, so please change it to say something "just the IRQs that the driver is interrupted by or needs to read back via a status command" and remove the second "Note:" comment entirely.
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.
Fixes #1112 which causes corrupt packets to silently be passed as valid by the driver.