Skip to content

Commit 8932ffd

Browse files
authored
Merge pull request #21 from RT-Thread/master
pr
2 parents bc28df8 + 2bf53d3 commit 8932ffd

File tree

46 files changed

+152
-3647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+152
-3647
lines changed

bsp/efm32/copy_this_file_dfs_elm.c

Lines changed: 0 additions & 964 deletions
This file was deleted.

bsp/efm32/copy_this_file_shell.c

Lines changed: 0 additions & 521 deletions
This file was deleted.

bsp/lpc2148/rtconfig.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@
8080
/* Using QEMU or SkyEye*/
8181
/* #define RT_USING_EMULATOR */
8282

83-
/* SECTION: a mini libc */
84-
/* Using mini libc library*/
85-
/* #define RT_USING_MINILIBC */
86-
8783
/* SECTION: C++ support */
8884
/* Using C++ support*/
8985
/* #define RT_USING_CPLUSPLUS */

bsp/microblaze/rtconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
/* SECTION: a runtime libc library */
9494
/* a runtime libc library*/
9595
/* #define RT_USING_NEWLIB */
96-
#define RT_USING_MINILIBC
9796

9897
/* SECTION: C++ support */
9998
/* Using C++ support*/

bsp/sam7x/rtconfig.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@
7272
#define FINSH_USING_SYMTAB
7373
#define FINSH_USING_DESCRIPTION
7474

75-
/* SECTION: a mini libc */
76-
/* Using mini libc library*/
77-
/* #define RT_USING_MINILIBC */
78-
7975
/* SECTION: C++ support */
8076
/* Using C++ support*/
8177
/* #define RT_USING_CPLUSPLUS */

bsp/stm32/libraries/HAL_Drivers/drv_dac.c

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,52 +37,74 @@ struct stm32_dac
3737

3838
static struct stm32_dac stm32_dac_obj[sizeof(dac_config) / sizeof(dac_config[0])];
3939

40+
static rt_uint32_t stm32_dac_get_channel(rt_uint32_t channel)
41+
{
42+
rt_uint32_t stm32_channel = 0;
43+
44+
switch (channel)
45+
{
46+
case 1:
47+
stm32_channel = DAC_CHANNEL_1;
48+
break;
49+
case 2:
50+
stm32_channel = DAC_CHANNEL_2;
51+
break;
52+
default:
53+
RT_ASSERT(0);
54+
break;
55+
}
56+
57+
return stm32_channel;
58+
}
59+
4060
static rt_err_t stm32_dac_enabled(struct rt_dac_device *device, rt_uint32_t channel)
4161
{
62+
uint32_t dac_channel;
4263
DAC_HandleTypeDef *stm32_dac_handler;
4364
RT_ASSERT(device != RT_NULL);
4465
stm32_dac_handler = device->parent.user_data;
4566

4667
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4)
47-
HAL_DAC_Start(stm32_dac_handler, channel);
68+
if ((channel <= 2) && (channel > 0))
69+
{
70+
/* set stm32 dac channel */
71+
dac_channel = stm32_dac_get_channel(channel);
72+
}
73+
else
74+
{
75+
LOG_E("dac channel must be 1 or 2.");
76+
return -RT_ERROR;
77+
}
78+
HAL_DAC_Start(stm32_dac_handler, dac_channel);
4879
#endif
4980

5081
return RT_EOK;
5182
}
5283

5384
static rt_err_t stm32_dac_disabled(struct rt_dac_device *device, rt_uint32_t channel)
5485
{
86+
uint32_t dac_channel;
5587
DAC_HandleTypeDef *stm32_dac_handler;
5688
RT_ASSERT(device != RT_NULL);
5789
stm32_dac_handler = device->parent.user_data;
5890

5991
#if defined(SOC_SERIES_STM32MP1) || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F4)
60-
HAL_DAC_Stop(stm32_dac_handler, channel);
92+
if ((channel <= 2) && (channel > 0))
93+
{
94+
/* set stm32 dac channel */
95+
dac_channel = stm32_dac_get_channel(channel);
96+
}
97+
else
98+
{
99+
LOG_E("dac channel must be 1 or 2.");
100+
return -RT_ERROR;
101+
}
102+
HAL_DAC_Stop(stm32_dac_handler, dac_channel);
61103
#endif
62104

63105
return RT_EOK;
64106
}
65107

66-
static rt_uint32_t stm32_dac_get_channel(rt_uint32_t channel)
67-
{
68-
rt_uint32_t stm32_channel = 0;
69-
70-
switch (channel)
71-
{
72-
case 1:
73-
stm32_channel = DAC_CHANNEL_1;
74-
break;
75-
case 2:
76-
stm32_channel = DAC_CHANNEL_2;
77-
break;
78-
default:
79-
RT_ASSERT(0);
80-
break;
81-
}
82-
83-
return stm32_channel;
84-
}
85-
86108
static rt_err_t stm32_set_dac_value(struct rt_dac_device *device, rt_uint32_t channel, rt_uint32_t *value)
87109
{
88110
uint32_t dac_channel;

bsp/stm32/libraries/HAL_Drivers/drv_usart.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ static rt_err_t stm32_configure(struct rt_serial_device *serial, struct serial_c
114114
switch (cfg->data_bits)
115115
{
116116
case DATA_BITS_8:
117-
uart->handle.Init.WordLength = UART_WORDLENGTH_8B;
117+
if (cfg->parity == PARITY_ODD || cfg->parity == PARITY_EVEN)
118+
uart->handle.Init.WordLength = UART_WORDLENGTH_9B;
119+
else
120+
uart->handle.Init.WordLength = UART_WORDLENGTH_8B;
118121
break;
119122
case DATA_BITS_9:
120123
uart->handle.Init.WordLength = UART_WORDLENGTH_9B;

bsp/wh44b0/rtconfig.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@
6565
/* Using FinSH as Shell*/
6666
/* #define RT_USING_FINSH */
6767

68-
/* SECTION: a mini libc */
69-
/* Using mini libc library*/
70-
/* #define RT_USING_MINILIBC */
71-
7268
/* SECTION: C++ support */
7369
/* Using C++ support*/
7470
/* #define RT_USING_CPLUSPLUS */

components/dfs/filesystems/nfs/rpc/types.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,14 @@
4747

4848
#include <string.h>
4949
#include <stdint.h>
50-
51-
#ifndef RT_USING_MINILIBC
52-
typedef unsigned int u_int;
53-
typedef unsigned char u_char;
54-
typedef unsigned long u_long;
55-
#else
5650
#include <sys/types.h>
57-
#include <stdint.h>
58-
#endif
5951

6052
typedef long long int64_t;
6153
typedef unsigned long long uint64_t;
6254

6355
typedef int bool_t;
6456
typedef int enum_t;
6557

66-
#ifndef RT_USING_NEWLIB
67-
typedef unsigned long dev_t;
68-
#endif
69-
70-
#if !defined(RT_USING_NEWLIB) && !defined(RT_USING_MINILIBC)
71-
typedef rt_int32_t ssize_t;
72-
#endif
73-
7458
/* This needs to be changed to uint32_t in the future */
7559
typedef unsigned long rpcprog_t;
7660
typedef unsigned long rpcvers_t;

components/libc/compilers/armlibc/sys/types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@ typedef long signed int ssize_t; /* Used for a count of bytes or an error
2525
#endif
2626
typedef unsigned long useconds_t; /* microseconds (unsigned) */
2727

28+
typedef unsigned long dev_t;
29+
30+
typedef unsigned int u_int;
31+
typedef unsigned char u_char;
32+
typedef unsigned long u_long;
33+
2834
#endif

0 commit comments

Comments
 (0)