diff --git a/cpu/kinetis_common/hwtimer_arch.c b/cpu/kinetis_common/hwtimer_arch.c index c2e10ab244..0eab2a2684 100644 --- a/cpu/kinetis_common/hwtimer_arch.c +++ b/cpu/kinetis_common/hwtimer_arch.c @@ -87,6 +87,7 @@ inline static void hwtimer_stop(void) void hwtimer_arch_init(void (*handler)(int), uint32_t fcpu) { + (void) fcpu; /* fcpu does not affect the Low power timer module frequency */ timeout_handler = handler; /* unlock LPTIMER_DEV */ @@ -146,7 +147,7 @@ void hwtimer_arch_disable_interrupt(void) void hwtimer_arch_set(unsigned long offset, short timer) { - (void)timer; + (void)timer; /* we only support one timer */ stimer.counter32b += lptmr_get_cnr(); hwtimer_stop(); @@ -165,7 +166,7 @@ void hwtimer_arch_set(unsigned long offset, short timer) void hwtimer_arch_set_absolute(unsigned long value, short timer) { - (void)timer; + (void)timer; /* we only support one timer */ stimer.counter32b += lptmr_get_cnr(); hwtimer_stop(); @@ -184,6 +185,7 @@ void hwtimer_arch_set_absolute(unsigned long value, short timer) void hwtimer_arch_unset(short timer) { + (void)timer; /* we only support one timer */ stimer.counter32b += lptmr_get_cnr(); hwtimer_stop(); stimer.diff = 0; diff --git a/cpu/kinetis_common/i2c.c b/cpu/kinetis_common/i2c.c index d958e0b75b..a35de4a55b 100644 --- a/cpu/kinetis_common/i2c.c +++ b/cpu/kinetis_common/i2c.c @@ -155,6 +155,8 @@ int i2c_init_master(i2c_t dev, i2c_speed_t speed) int i2c_init_slave(i2c_t dev, uint8_t address) { /* TODO: implement slave mode */ + (void) dev; + (void) address; return -1; } diff --git a/cpu/kinetis_common/random_rnga.c b/cpu/kinetis_common/random_rnga.c index 2917a3216f..3dcb8d48cf 100644 --- a/cpu/kinetis_common/random_rnga.c +++ b/cpu/kinetis_common/random_rnga.c @@ -35,7 +35,7 @@ void random_init(void) int random_read(char *buf, unsigned int num) { - int count = 0; + unsigned int count = 0; /* self-seeding */ while (!(KINETIS_RNGA->SR & RNG_SR_OREG_LVL_MASK)); @@ -55,7 +55,7 @@ int random_read(char *buf, unsigned int num) } } - return count; + return (int)count; } void random_poweron(void) diff --git a/cpu/kinetis_common/random_rngb.c b/cpu/kinetis_common/random_rngb.c index 30c6a4fd25..296d5961b2 100644 --- a/cpu/kinetis_common/random_rngb.c +++ b/cpu/kinetis_common/random_rngb.c @@ -37,7 +37,7 @@ void random_init(void) int random_read(char *buf, unsigned int num) { - int count = 0; + unsigned int count = 0; while (count < num) { uint32_t tmp; @@ -54,7 +54,7 @@ int random_read(char *buf, unsigned int num) } } - return count; + return (int)count; } void random_poweron(void) diff --git a/cpu/kinetis_common/spi.c b/cpu/kinetis_common/spi.c index 06c2d1b7f1..6d6b1529ba 100644 --- a/cpu/kinetis_common/spi.c +++ b/cpu/kinetis_common/spi.c @@ -464,12 +464,12 @@ static spi_state_t spi_config[SPI_NUMOF]; * @return The actual achieved frequency on success * @return Less than 0 on error. */ -static int find_closest_baudrate_scalers(const uint32_t module_clock, const uint32_t target_clock, +static long find_closest_baudrate_scalers(const uint32_t module_clock, const long target_clock, uint8_t *closest_prescaler, uint8_t *closest_scaler) { uint8_t i; uint8_t k; - int freq; + long freq; static const uint8_t num_scalers = 16; static const uint8_t num_prescalers = 4; static const int br_scalers[16] = { @@ -478,7 +478,7 @@ static int find_closest_baudrate_scalers(const uint32_t module_clock, const uint }; static const int br_prescalers[4] = {2, 3, 5, 7}; - int closest_frequency = -1; + long closest_frequency = -1; /* Test all combinations until we arrive close to the target clock */ for (i = 0; i < num_prescalers; ++i) { @@ -533,18 +533,18 @@ static int find_closest_baudrate_scalers(const uint32_t module_clock, const uint * @return The actual achieved frequency on success * @return Less than 0 on error. */ -static int find_closest_delay_scalers(const uint32_t module_clock, const uint32_t target_freq, +static long find_closest_delay_scalers(const uint32_t module_clock, const long target_freq, uint8_t *closest_prescaler, uint8_t *closest_scaler) { uint8_t i; uint8_t k; - int freq; + long freq; int prescaler; int scaler; static const uint8_t num_scalers = 16; static const uint8_t num_prescalers = 4; - int closest_frequency = -1; + long closest_frequency = -1; /* Test all combinations until we arrive close to the target clock */ for (i = 0; i < num_prescalers; ++i) { @@ -1041,13 +1041,13 @@ int spi_transfer_bytes(spi_t dev, char *out, char *in, unsigned int length) /* Default: send idle data */ byte_out = (uint8_t)SPI_IDLE_DATA; - for (i = 0; i < length; i++) { + for (i = 0; i < (int)length; i++) { if (out != NULL) { /* Send given out data */ byte_out = (uint8_t)out[i]; } - if (i >= length - 1) { + if (i >= (int)length - 1) { /* Last byte, set End-of-Queue flag, clear Continue flag. */ flags &= ~(SPI_PUSHR_CONT_MASK); flags |= SPI_PUSHR_EOQ_MASK; @@ -1248,13 +1248,13 @@ int spi_transfer_regs(spi_t dev, uint8_t reg, char *out, char *in, unsigned int /* Default: send idle data */ byte_out = (uint8_t)SPI_IDLE_DATA; - for (i = 0; i < length; i++) { + for (i = 0; i < (int)length; i++) { if (out != NULL) { /* Send given out data */ byte_out = (uint8_t)out[i]; } - if (i >= length - 1) { + if (i >= (int)length - 1) { /* Last byte, set End-of-Queue flag, clear Continue flag. */ flags &= ~(SPI_PUSHR_CONT_MASK); flags |= SPI_PUSHR_EOQ_MASK; diff --git a/cpu/kinetis_common/timer.c b/cpu/kinetis_common/timer.c index 0312699fdd..b5770722f0 100644 --- a/cpu/kinetis_common/timer.c +++ b/cpu/kinetis_common/timer.c @@ -144,6 +144,7 @@ int timer_set(tim_t dev, int channel, unsigned int timeout) int timer_set_absolute(tim_t dev, int channel, unsigned int value) { + (void) channel; /* we only support one channel */ switch (dev) { #if TIMER_0_EN @@ -179,6 +180,7 @@ int timer_set_absolute(tim_t dev, int channel, unsigned int value) int timer_clear(tim_t dev, int channel) { + (void) channel; /* we only support one channel */ switch (dev) { #if TIMER_0_EN