Skip to content

Commit 00d52b2

Browse files
committed
[bsp][nxp][rsoc] Fix compilation issues with bsp of nxp/lxp series
1 parent 68c856d commit 00d52b2

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

components/drivers/include/drivers/adc.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2023, RT-Thread Development Team
2+
* Copyright (c) 2006-2024 RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -22,39 +22,39 @@
2222
*
2323
* <b>Example</b>
2424
* @code {.c}
25-
* #define ADC_DEV_NAME "adc1"
26-
* #define ADC_DEV_CHANNEL 5
27-
* #define REFER_VOLTAGE 330
28-
* #define CONVERT_BITS (1 << 12)
29-
*
25+
* #define ADC_DEV_NAME "adc1"
26+
* #define ADC_DEV_CHANNEL 5
27+
* #define REFER_VOLTAGE 330
28+
* #define CONVERT_BITS (1 << 12)
29+
*
3030
* static int adc_vol_sample(int argc, char *argv[])
3131
* {
3232
* rt_adc_device_t adc_dev;
3333
* rt_uint32_t value, vol;
34-
*
34+
*
3535
* rt_err_t ret = RT_EOK;
36-
*
36+
*
3737
* adc_dev = (rt_adc_device_t)rt_device_find(ADC_DEV_NAME);
3838
* if (adc_dev == RT_NULL)
3939
* {
4040
* rt_kprintf("adc sample run failed! can't find %s device!\n", ADC_DEV_NAME);
41-
* return RT_ERROR;
41+
* return -RT_ERROR;
4242
* }
43-
*
43+
*
4444
* ret = rt_adc_enable(adc_dev, ADC_DEV_CHANNEL);
45-
*
45+
*
4646
* value = rt_adc_read(adc_dev, ADC_DEV_CHANNEL);
4747
* rt_kprintf("the value is :%d \n", value);
48-
*
48+
*
4949
* vol = value * REFER_VOLTAGE / CONVERT_BITS;
5050
* rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100);
51-
*
51+
*
5252
* ret = rt_adc_disable(adc_dev, ADC_DEV_CHANNEL);
53-
*
53+
*
5454
* return ret;
5555
* }
5656
* MSH_CMD_EXPORT(adc_vol_sample, adc voltage convert sample);
57-
*
57+
*
5858
* @endcode
5959
*
6060
* @ingroup Drivers

components/drivers/include/drivers/dac.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2023, RT-Thread Development Team
2+
* Copyright (c) 2006-2024 RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -19,47 +19,47 @@
1919
*
2020
* <b>Example</b>
2121
* @code {.c}
22-
*
22+
*
2323
* #include <rtthread.h>
2424
* #include <rtdevice.h>
2525
* #include <stdlib.h>
26-
* #define DAC_DEV_NAME "dac1"
27-
* #define DAC_DEV_CHANNEL 1
28-
* #define REFER_VOLTAGE 330
29-
* #define CONVERT_BITS (1 << 12)
30-
*
26+
* #define DAC_DEV_NAME "dac1"
27+
* #define DAC_DEV_CHANNEL 1
28+
* #define REFER_VOLTAGE 330
29+
* #define CONVERT_BITS (1 << 12)
30+
*
3131
* static int dac_vol_sample(int argc, char *argv[])
3232
* {
3333
* rt_dac_device_t dac_dev;
3434
* rt_uint32_t value, vol;
3535
* rt_err_t ret = RT_EOK;
36-
*
36+
*
3737
* dac_dev = (rt_dac_device_t)rt_device_find(DAC_DEV_NAME);
3838
* if (dac_dev == RT_NULL)
3939
* {
4040
* rt_kprintf("dac sample run failed! can't find %s device!\n", DAC_DEV_NAME);
41-
* return RT_ERROR;
41+
* return -RT_ERROR;
4242
* }
43-
*
43+
*
4444
* ret = rt_dac_enable(dac_dev, DAC_DEV_CHANNEL);
45-
*
45+
*
4646
* value = atoi(argv[1]);
4747
* rt_dac_write(dac_dev, DAC_DEV_NAME, DAC_DEV_CHANNEL, value);
4848
* rt_kprintf("the value is :%d \n", value);
49-
*
49+
*
5050
* vol = value * REFER_VOLTAGE / CONVERT_BITS;
5151
* rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100);
52-
*
52+
*
5353
* rt_thread_mdelay(500);
54-
*
54+
*
5555
* ret = rt_dac_disable(dac_dev, DAC_DEV_CHANNEL);
56-
*
56+
*
5757
* return ret;
5858
* }
5959
* MSH_CMD_EXPORT(dac_vol_sample, dac voltage convert sample);
60-
*
60+
*
6161
* @endcode
62-
*
62+
*
6363
* @ingroup Drivers
6464
*/
6565

@@ -80,7 +80,7 @@ struct rt_dac_ops
8080
};
8181
/**
8282
* @brief DAC device structure
83-
*
83+
*
8484
*/
8585
struct rt_dac_device
8686
{

0 commit comments

Comments
 (0)