drivers/sx127x: Fix misc variable types and lengths#7851
drivers/sx127x: Fix misc variable types and lengths#7851kYc0o merged 4 commits intoRIOT-OS:masterfrom
Conversation
| typedef struct { | ||
| uint16_t preamble_len; /**< Length of preamble header */ | ||
| uint8_t power; /**< Signal power */ | ||
| int8_t power; /**< Signal power */ |
There was a problem hiding this comment.
This change doesn't seem to be related to compiler issues but it's a valid one regarding LoRa: the power in dBm can indeed be negative.
Note that you also need to update the netdev _set function according to this change.
There was a problem hiding this comment.
clang rise an error of assigning negative values to this variable. Besides the fact that yes, conceptually this should be a uint8_t.
The netdev change was already done, that's why Murdock agrees.
There was a problem hiding this comment.
I think you misunderstood my comment. Using an int8_t is correct since power can be negative. But the netdev _set function should be adapted as well and this is not done by this PR. See this line
The line just under is also erroneous as it returns sizeof(uint16_t) and it should be sizeof(int8_t according to this PR.
5bbaa21 to
5a46a01
Compare
|
Go! |
While compiling tests/driver_sx127x with clang in OS X it discovers several minor issues.
This PR fixes them.