Skip to content

Commit

Permalink
cpu/samd21: Cast enum to unsigned int for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård committed Feb 27, 2016
1 parent af64264 commit 3ff4a33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cpu/samd21/periph/pwm.c
Expand Up @@ -93,7 +93,7 @@ uint32_t pwm_init(pwm_t dev, pwm_mode_t mode, uint32_t freq, uint16_t res)
int scale = 1;
uint32_t f_real;

if (dev >= PWM_NUMOF) {
if ((unsigned int)dev >= PWM_NUMOF) {
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions cpu/samd21/periph/spi.c
Expand Up @@ -210,7 +210,7 @@ void spi_transmission_begin(spi_t dev, char reset_val)

int spi_acquire(spi_t dev)
{
if (dev >= SPI_NUMOF) {
if ((unsigned int)dev >= SPI_NUMOF) {
return -1;
}
mutex_lock(&locks[dev]);
Expand All @@ -219,7 +219,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]);
Expand Down

0 comments on commit 3ff4a33

Please sign in to comment.