dr_range bitfield should be unsigned integer

If the value is an integer, the 4th bit is used for sign, so you can store
values upto 7 only whereas the datarate values could go upto 15. That's why
we need to turn this to an unsigned integer so that the last bit can also be used.
pull/6938/head
Hasnain Virk 2018-05-17 12:38:27 +03:00
parent 9ac7f21140
commit 493ae2bd91
1 changed files with 3 additions and 3 deletions

View File

@ -275,7 +275,7 @@ typedef union {
/**
* Byte-access to the bits.
*/
int8_t value;
uint8_t value;
/**
* The structure to store the minimum and the maximum datarate.
*/
@ -288,7 +288,7 @@ typedef union {
* The allowed ranges are region-specific.
* Please refer to \ref DR_0 to \ref DR_15 for details.
*/
int8_t min : 4;
uint8_t min : 4;
/**
* The maximum data rate.
*
@ -297,7 +297,7 @@ typedef union {
* The allowed ranges are region-specific.
* Please refer to \ref DR_0 to \ref DR_15 for details.
*/
int8_t max : 4;
uint8_t max : 4;
} fields;
} dr_range_t;