[riot-devel] CC2538 RF Driver Data Types

Aaron Sowry aeneby at gmail.com
Wed Aug 17 06:10:50 CEST 2016


Hi Jason,

> According to the CC2538 user manual, some of the register values from the radio are signed

Are you referring to the RSSI bit here? Typecasting this value should
be fine, so long as you are casting to an 8-bit signed integer.
Strictly speaking I think this behaviour is implementation-defined,
but in practice it should be safe so long as the two types are the
same width.

Cheers
Aaron

2016-08-17 8:31 GMT+12:00 Jason A. Tran <jasontra at usc.edu>:
> Hi All,
>
> According to the CC2538 user manual, some of the register values from the
> radio are signed. The current RF driver uses uint_fast8_t as the return type
> of rfcore_read_byte(). Is it generally safe to typecast the return value to
> a signed integer? If not, what's the best way to handle this?
>
> Best Regards,
> Jason Tran
>
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>


More information about the devel mailing list