Add type cast

pull/6733/head
Keyur Hariya 2018-04-23 15:43:46 -05:00
parent b033a6e42e
commit 11cf79ecb0
6 changed files with 6 additions and 9 deletions

View File

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

View File

@ -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);
}
//******************************************************************************

View File

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

View File

@ -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);
}
//******************************************************************************

View File

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

View File

@ -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);
}
//******************************************************************************