Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly checking sx128x command status #843

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

chemary
Copy link
Contributor

@chemary chemary commented Oct 10, 2023

In SX128x::SPIparseStatus the bit mask to check the command status is incorrect, it's checking bits 3:1 when the documentation says that are 4:2
image

You can replace the constants and clearly see that they don't make sense

if((status & 0b00001110) == RADIOLIB_SX128X_STATUS_CMD_TIMEOUT)
if((status & 0b00001110) == RADIOLIB_SX128X_STATUS_CMD_ERROR)
if((status & 0b00001110) == RADIOLIB_SX128X_STATUS_CMD_FAILED)
// replacing the constant becomes
if((status & 0b00001110) == 0b00001100)
if((status & 0b00001110) == 0b00010000)
if((status & 0b00001110) == 0b00010100)

@jgromes jgromes merged commit ddcce42 into jgromes:master Oct 11, 2023
29 checks passed
@jgromes
Copy link
Owner

jgromes commented Oct 11, 2023

Seems like a copy-paste error from the SX126x driver. Merged, thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants