mirror of https://github.com/ARMmbed/mbed-os.git
Add type cast
parent
b033a6e42e
commit
11cf79ecb0
|
@ -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);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
|
Loading…
Reference in New Issue