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

fix sanity checks for new CFG_sx1276_radio boards #790

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lmic/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ int radio_init () {
// some sanity checks, e.g., read version number
u1_t v = readReg(RegVersion);
#ifdef CFG_sx1276_radio
if(v != 0x12 )
if(v != 0x12 & v != 0x13)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(v != 0x12 & v != 0x13):

This should be &&, not &. Or else if ((v & ~1u) == 0x12), which might be smaller on AVR. Ideally, this would be a macro or inline check: if (is_sx1276_like(v)), where is_sx1276_like() looks at v and makes the decision.

We've not heard more on this since the last few years; has Semtech documented this? Or is this not relevant after all?

return 0;
#elif CFG_sx1272_radio
if(v != 0x22)
Expand Down