diff options
| author | hydevcode <[email protected]> | 2024-09-30 08:47:39 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-29 20:47:39 -0400 |
| commit | 66d54ea8c0f6eae5713985a7fffd099ef3eea621 (patch) | |
| tree | f8ffdefca14a723c4c157c710affd4b0cfdedd23 /components | |
| parent | e7e44ec7e8ad8ea5a8642a09ad51bdfb1ca73408 (diff) | |
[bsp][nxp][rsoc] Fix compilation issues with bsp of nxp/lxp series
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/include/drivers/adc.h | 30 | ||||
| -rw-r--r-- | components/drivers/include/drivers/dac.h | 36 |
2 files changed, 33 insertions, 33 deletions
diff --git a/components/drivers/include/drivers/adc.h b/components/drivers/include/drivers/adc.h index cdb7b2704a..7189ae5eda 100644 --- a/components/drivers/include/drivers/adc.h +++ b/components/drivers/include/drivers/adc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2023, RT-Thread Development Team + * Copyright (c) 2006-2024 RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -22,39 +22,39 @@ * * <b>Example</b> * @code {.c} - * #define ADC_DEV_NAME "adc1" - * #define ADC_DEV_CHANNEL 5 - * #define REFER_VOLTAGE 330 - * #define CONVERT_BITS (1 << 12) - * + * #define ADC_DEV_NAME "adc1" + * #define ADC_DEV_CHANNEL 5 + * #define REFER_VOLTAGE 330 + * #define CONVERT_BITS (1 << 12) + * * static int adc_vol_sample(int argc, char *argv[]) * { * rt_adc_device_t adc_dev; * rt_uint32_t value, vol; - * + * * rt_err_t ret = RT_EOK; - * + * * adc_dev = (rt_adc_device_t)rt_device_find(ADC_DEV_NAME); * if (adc_dev == RT_NULL) * { * rt_kprintf("adc sample run failed! can't find %s device!\n", ADC_DEV_NAME); - * return RT_ERROR; + * return -RT_ERROR; * } - * + * * ret = rt_adc_enable(adc_dev, ADC_DEV_CHANNEL); - * + * * value = rt_adc_read(adc_dev, ADC_DEV_CHANNEL); * rt_kprintf("the value is :%d \n", value); - * + * * vol = value * REFER_VOLTAGE / CONVERT_BITS; * rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100); - * + * * ret = rt_adc_disable(adc_dev, ADC_DEV_CHANNEL); - * + * * return ret; * } * MSH_CMD_EXPORT(adc_vol_sample, adc voltage convert sample); - * + * * @endcode * * @ingroup Drivers diff --git a/components/drivers/include/drivers/dac.h b/components/drivers/include/drivers/dac.h index f3635d50b6..b1360c3588 100644 --- a/components/drivers/include/drivers/dac.h +++ b/components/drivers/include/drivers/dac.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2023, RT-Thread Development Team + * Copyright (c) 2006-2024 RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * @@ -19,47 +19,47 @@ * * <b>Example</b> * @code {.c} - * + * * #include <rtthread.h> * #include <rtdevice.h> * #include <stdlib.h> - * #define DAC_DEV_NAME "dac1" - * #define DAC_DEV_CHANNEL 1 - * #define REFER_VOLTAGE 330 - * #define CONVERT_BITS (1 << 12) - * + * #define DAC_DEV_NAME "dac1" + * #define DAC_DEV_CHANNEL 1 + * #define REFER_VOLTAGE 330 + * #define CONVERT_BITS (1 << 12) + * * static int dac_vol_sample(int argc, char *argv[]) * { * rt_dac_device_t dac_dev; * rt_uint32_t value, vol; * rt_err_t ret = RT_EOK; - * + * * dac_dev = (rt_dac_device_t)rt_device_find(DAC_DEV_NAME); * if (dac_dev == RT_NULL) * { * rt_kprintf("dac sample run failed! can't find %s device!\n", DAC_DEV_NAME); - * return RT_ERROR; + * return -RT_ERROR; * } - * + * * ret = rt_dac_enable(dac_dev, DAC_DEV_CHANNEL); - * + * * value = atoi(argv[1]); * rt_dac_write(dac_dev, DAC_DEV_NAME, DAC_DEV_CHANNEL, value); * rt_kprintf("the value is :%d \n", value); - * + * * vol = value * REFER_VOLTAGE / CONVERT_BITS; * rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100); - * + * * rt_thread_mdelay(500); - * + * * ret = rt_dac_disable(dac_dev, DAC_DEV_CHANNEL); - * + * * return ret; * } * MSH_CMD_EXPORT(dac_vol_sample, dac voltage convert sample); - * + * * @endcode - * + * * @ingroup Drivers */ @@ -80,7 +80,7 @@ struct rt_dac_ops }; /** * @brief DAC device structure - * + * */ struct rt_dac_device { |
