cpu/cc2538: Cast enum to unsigned int for comparison

pr/spi.typo
Joakim Nohlgård 7 years ago
parent 4a70299d6a
commit c2b20f1f27

@ -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;
}

Loading…
Cancel
Save