Merge pull request #2930 from murphyzhao/fix-assert
[bsp][stm32] fix RT_ASSERT location error
This commit is contained in:
commit
48afe9318a
|
@ -44,9 +44,9 @@ static struct stm32_adc stm32_adc_obj[sizeof(adc_config) / sizeof(adc_config[0])
|
||||||
|
|
||||||
static rt_err_t stm32_adc_enabled(struct rt_adc_device *device, rt_uint32_t channel, rt_bool_t enabled)
|
static rt_err_t stm32_adc_enabled(struct rt_adc_device *device, rt_uint32_t channel, rt_bool_t enabled)
|
||||||
{
|
{
|
||||||
ADC_HandleTypeDef *stm32_adc_handler = device->parent.user_data;
|
ADC_HandleTypeDef *stm32_adc_handler;
|
||||||
|
|
||||||
RT_ASSERT(device != RT_NULL);
|
RT_ASSERT(device != RT_NULL);
|
||||||
|
stm32_adc_handler = device->parent.user_data;
|
||||||
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
{
|
{
|
||||||
|
@ -141,11 +141,13 @@ static rt_uint32_t stm32_adc_get_channel(rt_uint32_t channel)
|
||||||
static rt_err_t stm32_get_adc_value(struct rt_adc_device *device, rt_uint32_t channel, rt_uint32_t *value)
|
static rt_err_t stm32_get_adc_value(struct rt_adc_device *device, rt_uint32_t channel, rt_uint32_t *value)
|
||||||
{
|
{
|
||||||
ADC_ChannelConfTypeDef ADC_ChanConf;
|
ADC_ChannelConfTypeDef ADC_ChanConf;
|
||||||
ADC_HandleTypeDef *stm32_adc_handler = device->parent.user_data;
|
ADC_HandleTypeDef *stm32_adc_handler;
|
||||||
|
|
||||||
RT_ASSERT(device != RT_NULL);
|
RT_ASSERT(device != RT_NULL);
|
||||||
RT_ASSERT(value != RT_NULL);
|
RT_ASSERT(value != RT_NULL);
|
||||||
|
|
||||||
|
stm32_adc_handler = device->parent.user_data;
|
||||||
|
|
||||||
rt_memset(&ADC_ChanConf, 0, sizeof(ADC_ChanConf));
|
rt_memset(&ADC_ChanConf, 0, sizeof(ADC_ChanConf));
|
||||||
|
|
||||||
#if defined(SOC_SERIES_STM32F1)
|
#if defined(SOC_SERIES_STM32F1)
|
||||||
|
|
Loading…
Reference in New Issue