mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #6733 from maximmbed/fix-compiler-warnings
Fix compiler warnings for Maxim platformspull/6762/head
commit
6ccc963b61
|
|
@ -50,7 +50,7 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
|
||||
// Set the object pointer and channel encoding
|
||||
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) {
|
||||
MBED_ASSERT(ADC_Init() == E_NO_ERROR);
|
||||
|
|
@ -93,4 +93,3 @@ uint16_t analogin_read_u16(analogin_t *obj)
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
|
|||
//******************************************************************************
|
||||
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);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ int LP_ConfigGPIOWakeUpDetect(const gpio_cfg_t *gpio, unsigned int act_high, lp_
|
|||
return result;
|
||||
}
|
||||
|
||||
uint8_t LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio)
|
||||
int LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio)
|
||||
{
|
||||
uint8_t gpioWokeUp = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* @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
|
||||
* @returns frequency in Hz
|
||||
*/
|
||||
uint32_t SYS_SPIX_GetFreq();
|
||||
uint32_t SYS_SPIX_GetFreq(void);
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @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
|
||||
* @returns frequency in Hz
|
||||
*/
|
||||
uint32_t SYS_SPIS_GetFreq();
|
||||
uint32_t SYS_SPIS_GetFreq(void);
|
||||
|
||||
/**
|
||||
* @brief System level initialization for OWM module.
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ int SPIS_Shutdown(mxc_spis_regs_t *spis)
|
|||
}
|
||||
|
||||
// Clear system level configurations
|
||||
if ((err = SYS_SPIS_Shutdown(spis)) != E_NO_ERROR) {
|
||||
if ((err = SYS_SPIS_Shutdown()) != E_NO_ERROR) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "lp_ticker_api.h"
|
||||
#include "rtc.h"
|
||||
#include "lp.h"
|
||||
#include <string.h>
|
||||
|
||||
// LOG2 for 32-bit powers of 2
|
||||
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
||||
|
|
@ -65,7 +66,8 @@ static void init_rtc(void)
|
|||
* if it is already running.
|
||||
*/
|
||||
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.snoozeMode = RTC_SNOOZE_DISABLE;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
|
||||
// Set the object pointer and channel encoding
|
||||
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) {
|
||||
MBED_ASSERT(ADC_Init() == E_NO_ERROR);
|
||||
|
|
@ -93,4 +93,3 @@ uint16_t analogin_read_u16(analogin_t *obj)
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
|
|||
//******************************************************************************
|
||||
void i2c_frequency(i2c_t *obj, int hz)
|
||||
{
|
||||
I2CM_SetFrequency(obj->i2c, hz);
|
||||
I2CM_SetFrequency(obj->i2c, (i2cm_speed_t)hz);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ int LP_ConfigGPIOWakeUpDetect(const gpio_cfg_t *gpio, unsigned int act_high, lp_
|
|||
return result;
|
||||
}
|
||||
|
||||
uint8_t LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio)
|
||||
int LP_IsGPIOWakeUpSource(const gpio_cfg_t *gpio)
|
||||
{
|
||||
uint8_t gpioWokeUp = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "lp_ticker_api.h"
|
||||
#include "rtc.h"
|
||||
#include "lp.h"
|
||||
#include <string.h>
|
||||
|
||||
// LOG2 for 32-bit powers of 2
|
||||
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
||||
|
|
@ -65,7 +66,8 @@ static void init_rtc(void)
|
|||
* if it is already running.
|
||||
*/
|
||||
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.snoozeMode = RTC_SNOOZE_DISABLE;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
|
||||
// Set the object pointer and channel encoding
|
||||
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) {
|
||||
MBED_ASSERT(ADC_Init() == E_NO_ERROR);
|
||||
|
|
@ -93,4 +93,3 @@ uint16_t analogin_read_u16(analogin_t *obj)
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
|
|||
//******************************************************************************
|
||||
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);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* @ingroup spix
|
||||
*/
|
||||
int SYS_SPIX_Shutdown();
|
||||
int SYS_SPIX_Shutdown(void);
|
||||
|
||||
/**
|
||||
* @brief Get the frequency of the SPIX module source clock
|
||||
* @return frequency in Hz
|
||||
* @ingroup spix
|
||||
*/
|
||||
uint32_t SYS_SPIX_GetFreq();
|
||||
uint32_t SYS_SPIX_GetFreq(void);
|
||||
|
||||
/**
|
||||
* @brief System level initialization for OWM module.
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "lp_ticker_api.h"
|
||||
#include "rtc.h"
|
||||
#include "lp.h"
|
||||
#include <string.h>
|
||||
|
||||
// LOG2 for 32-bit powers of 2
|
||||
#define LOG2_1(n) (((n) >= (1 << 1)) ? 1 : 0)
|
||||
|
|
@ -65,7 +66,8 @@ static void init_rtc(void)
|
|||
* if it is already running.
|
||||
*/
|
||||
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.snoozeMode = RTC_SNOOZE_DISABLE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue