1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

cpu/cc2538: Cast enum to unsigned int for comparison

This commit is contained in:
Joakim Nohlgård 2016-06-01 16:39:55 +02:00
parent 92370e846d
commit abca77beb0

View File

@ -55,7 +55,7 @@ int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed)
{
cc2538_ssi_t* ssi = spi_config[dev].dev;
if (dev >= SPI_NUMOF) {
if ((unsigned int)dev >= SPI_NUMOF) {
return -1;
}
@ -160,7 +160,7 @@ int spi_init_slave(spi_t dev, spi_conf_t conf, char(*cb)(char data))
int spi_conf_pins(spi_t dev)
{
if (dev >= SPI_NUMOF) {
if ((unsigned int)dev >= SPI_NUMOF) {
return -1;
}
@ -197,7 +197,7 @@ int spi_conf_pins(spi_t dev)
int spi_acquire(spi_t dev)
{
if (dev >= SPI_NUMOF) {
if ((unsigned int)dev >= SPI_NUMOF) {
return -1;
}
mutex_lock(&locks[dev]);
@ -206,7 +206,7 @@ int spi_acquire(spi_t dev)
int spi_release(spi_t dev)
{
if (dev >= SPI_NUMOF) {
if ((unsigned int)dev >= SPI_NUMOF) {
return -1;
}
mutex_unlock(&locks[dev]);
@ -251,7 +251,7 @@ int spi_transfer_bytes(spi_t dev, char *out, char *in, unsigned int length)
cc2538_ssi_t* ssi = spi_config[dev].dev;
typeof(length) tx_n = 0, rx_n = 0;
if (dev >= SPI_NUMOF) {
if ((unsigned int)dev >= SPI_NUMOF) {
return -1;
}