Merge pull request #6733 from maximmbed/fix-compiler-warnings

Fix compiler warnings for Maxim platforms
pull/6762/head
Cruz Monrreal 2018-04-26 20:18:32 -05:00 committed by GitHub
commit 6ccc963b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 48 additions and 45 deletions

View File

@ -50,7 +50,7 @@ void analogin_init(analogin_t *obj, PinName pin)
// Set the object pointer and channel encoding // Set the object pointer and channel encoding
obj->adc = MXC_ADC; obj->adc = MXC_ADC;
obj->channel = pinmap_find_function(pin, PinMap_ADC); obj->channel = (mxc_adc_chsel_t)pinmap_find_function(pin, PinMap_ADC);
if (!initialized) { if (!initialized) {
MBED_ASSERT(ADC_Init() == E_NO_ERROR); MBED_ASSERT(ADC_Init() == E_NO_ERROR);
@ -93,4 +93,3 @@ uint16_t analogin_read_u16(analogin_t *obj)
return result; return result;
} }

View File

@ -78,7 +78,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
//****************************************************************************** //******************************************************************************
void i2c_frequency(i2c_t *obj, int hz) void i2c_frequency(i2c_t *obj, int hz)
{ {
I2CM_Init(obj->i2c, &obj->sys_cfg, hz); I2CM_Init(obj->i2c, &obj->sys_cfg, (i2cm_speed_t)hz);
} }
//****************************************************************************** //******************************************************************************

View File

@ -179,7 +179,7 @@ int LP_ConfigGPIOWakeUpDetect(const gpio_cfg_t *gpio, unsigned int act_high, lp_
return result; return result;
} }
uint8_t LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio) int LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio)
{ {
uint8_t gpioWokeUp = 0; uint8_t gpioWokeUp = 0;

View File

@ -138,7 +138,7 @@ int LP_ClearGPIOWakeUpDetect(const gpio_cfg_t *gpio);
* nonzero = at least one of the gpio passed in triggered a wake up * nonzero = at least one of the gpio passed in triggered a wake up
* the bit set represents which pin is the wake up source * the bit set represents which pin is the wake up source
*/ */
uint8_t LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio); int LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio);
/** /**
* @brief Wake on USB plug or unplug * @brief Wake on USB plug or unplug

View File

@ -240,13 +240,13 @@ int SYS_SPIX_Init(const sys_cfg_spix_t *sys_cfg, uint32_t baud);
* @brief System level shutdown for SPIX module * @brief System level shutdown for SPIX module
* @returns E_NO_ERROR if everything is successful * @returns E_NO_ERROR if everything is successful
*/ */
int SYS_SPIX_Shutdown(); int SYS_SPIX_Shutdown(void);
/** /**
* @brief Get the frequency of the SPIX module source clock * @brief Get the frequency of the SPIX module source clock
* @returns frequency in Hz * @returns frequency in Hz
*/ */
uint32_t SYS_SPIX_GetFreq(); uint32_t SYS_SPIX_GetFreq(void);
/** /**
* @brief System level initialization for SPIS module. * @brief System level initialization for SPIS module.
@ -259,13 +259,13 @@ int SYS_SPIS_Init(const sys_cfg_spix_t *sys_cfg);
* @brief System level shutdown for SPIS module * @brief System level shutdown for SPIS module
* @returns E_NO_ERROR if everything is successful * @returns E_NO_ERROR if everything is successful
*/ */
int SYS_SPIS_Shutdown(); int SYS_SPIS_Shutdown(void);
/** /**
* @brief Get the frequency of the SPIS module source clock * @brief Get the frequency of the SPIS module source clock
* @returns frequency in Hz * @returns frequency in Hz
*/ */
uint32_t SYS_SPIS_GetFreq(); uint32_t SYS_SPIS_GetFreq(void);
/** /**
* @brief System level initialization for OWM module. * @brief System level initialization for OWM module.

View File

@ -119,7 +119,7 @@ int SPIS_Shutdown(mxc_spis_regs_t *spis)
} }
// Clear system level configurations // Clear system level configurations
if ((err = SYS_SPIS_Shutdown(spis)) != E_NO_ERROR) { if ((err = SYS_SPIS_Shutdown()) != E_NO_ERROR) {
return err; return err;
} }

View File

@ -35,6 +35,7 @@
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#include "rtc.h" #include "rtc.h"
#include "lp.h" #include "lp.h"
#include <string.h>
// LOG2 for 32-bit powers of 2 // LOG2 for 32-bit powers of 2
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0) #define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
@ -65,7 +66,8 @@ static void init_rtc(void)
* if it is already running. * if it is already running.
*/ */
if (!RTC_IsActive()) { if (!RTC_IsActive()) {
rtc_cfg_t cfg = { 0 }; rtc_cfg_t cfg;
memset(&cfg, 0, sizeof(rtc_cfg_t));
cfg.prescaler = LP_TIMER_PRESCALE; cfg.prescaler = LP_TIMER_PRESCALE;
cfg.snoozeMode = RTC_SNOOZE_DISABLE; cfg.snoozeMode = RTC_SNOOZE_DISABLE;

View File

@ -50,7 +50,7 @@ void analogin_init(analogin_t *obj, PinName pin)
// Set the object pointer and channel encoding // Set the object pointer and channel encoding
obj->adc = MXC_ADC; obj->adc = MXC_ADC;
obj->channel = pinmap_find_function(pin, PinMap_ADC); obj->channel = (mxc_adc_chsel_t)pinmap_find_function(pin, PinMap_ADC);
if (!initialized) { if (!initialized) {
MBED_ASSERT(ADC_Init() == E_NO_ERROR); MBED_ASSERT(ADC_Init() == E_NO_ERROR);
@ -93,4 +93,3 @@ uint16_t analogin_read_u16(analogin_t *obj)
return result; return result;
} }

View File

@ -79,7 +79,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
//****************************************************************************** //******************************************************************************
void i2c_frequency(i2c_t *obj, int hz) void i2c_frequency(i2c_t *obj, int hz)
{ {
I2CM_SetFrequency(obj->i2c, hz); I2CM_SetFrequency(obj->i2c, (i2cm_speed_t)hz);
} }
//****************************************************************************** //******************************************************************************

View File

@ -178,7 +178,7 @@ int LP_ConfigGPIOWakeUpDetect(const gpio_cfg_t *gpio, unsigned int act_high, lp_
return result; return result;
} }
uint8_t LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio) int LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio)
{ {
uint8_t gpioWokeUp = 0; uint8_t gpioWokeUp = 0;

View File

@ -138,7 +138,7 @@ int LP_ClearGPIOWakeUpDetect(const gpio_cfg_t *gpio);
* nonzero = at least one of the gpio passed in triggered a wake up * nonzero = at least one of the gpio passed in triggered a wake up
* the bit set represents which pin is the wake up source * the bit set represents which pin is the wake up source
*/ */
uint8_t LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio); int LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio);
/** /**
* @brief Wake on USB plug or unplug * @brief Wake on USB plug or unplug

View File

@ -35,6 +35,7 @@
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#include "rtc.h" #include "rtc.h"
#include "lp.h" #include "lp.h"
#include <string.h>
// LOG2 for 32-bit powers of 2 // LOG2 for 32-bit powers of 2
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0) #define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
@ -65,7 +66,8 @@ static void init_rtc(void)
* if it is already running. * if it is already running.
*/ */
if (!RTC_IsActive()) { if (!RTC_IsActive()) {
rtc_cfg_t cfg = { 0 }; rtc_cfg_t cfg;
memset(&cfg, 0, sizeof(rtc_cfg_t));
cfg.prescaler = LP_TIMER_PRESCALE; cfg.prescaler = LP_TIMER_PRESCALE;
cfg.snoozeMode = RTC_SNOOZE_DISABLE; cfg.snoozeMode = RTC_SNOOZE_DISABLE;

View File

@ -50,7 +50,7 @@ void analogin_init(analogin_t *obj, PinName pin)
// Set the object pointer and channel encoding // Set the object pointer and channel encoding
obj->adc = MXC_ADC; obj->adc = MXC_ADC;
obj->channel = pinmap_find_function(pin, PinMap_ADC); obj->channel = (mxc_adc_chsel_t)pinmap_find_function(pin, PinMap_ADC);
if (!initialized) { if (!initialized) {
MBED_ASSERT(ADC_Init() == E_NO_ERROR); MBED_ASSERT(ADC_Init() == E_NO_ERROR);
@ -93,4 +93,3 @@ uint16_t analogin_read_u16(analogin_t *obj)
return result; return result;
} }

View File

@ -78,7 +78,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
//****************************************************************************** //******************************************************************************
void i2c_frequency(i2c_t *obj, int hz) void i2c_frequency(i2c_t *obj, int hz)
{ {
I2CM_Init(obj->i2c, &obj->sys_cfg, hz); I2CM_Init(obj->i2c, &obj->sys_cfg, (i2cm_speed_t)hz);
} }
//****************************************************************************** //******************************************************************************

View File

@ -299,14 +299,14 @@ int SYS_SPIX_Init(const sys_cfg_spix_t *sys_cfg, uint32_t baud);
* @return #E_NO_ERROR if everything is successful * @return #E_NO_ERROR if everything is successful
* @ingroup spix * @ingroup spix
*/ */
int SYS_SPIX_Shutdown(); int SYS_SPIX_Shutdown(void);
/** /**
* @brief Get the frequency of the SPIX module source clock * @brief Get the frequency of the SPIX module source clock
* @return frequency in Hz * @return frequency in Hz
* @ingroup spix * @ingroup spix
*/ */
uint32_t SYS_SPIX_GetFreq(); uint32_t SYS_SPIX_GetFreq(void);
/** /**
* @brief System level initialization for OWM module. * @brief System level initialization for OWM module.

View File

@ -35,6 +35,7 @@
#include "lp_ticker_api.h" #include "lp_ticker_api.h"
#include "rtc.h" #include "rtc.h"
#include "lp.h" #include "lp.h"
#include <string.h>
// LOG2 for 32-bit powers of 2 // LOG2 for 32-bit powers of 2
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0) #define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
@ -65,7 +66,8 @@ static void init_rtc(void)
* if it is already running. * if it is already running.
*/ */
if (!RTC_IsActive()) { if (!RTC_IsActive()) {
rtc_cfg_t cfg = {0}; rtc_cfg_t cfg;
memset(&cfg, 0, sizeof(rtc_cfg_t));
cfg.prescaler = LP_TIMER_PRESCALE; cfg.prescaler = LP_TIMER_PRESCALE;
cfg.snoozeMode = RTC_SNOOZE_DISABLE; cfg.snoozeMode = RTC_SNOOZE_DISABLE;