Skip to content

Commit f9c2b5a

Browse files
[bsp][gd32]:gd32vw553h-eval refine wdt and modify ai review
1 parent 45b3670 commit f9c2b5a

2 files changed

Lines changed: 12 additions & 27 deletions

File tree

bsp/gd32/risc-v/gd32vw553h-eval/board/Kconfig

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,6 @@ menu "On-chip Peripheral Drivers"
5656
depends on BSP_USING_UART2
5757
select RT_SERIAL_USING_DMA
5858
default n
59-
60-
config BSP_USING_UART3
61-
bool "Enable UART3"
62-
default n
63-
64-
config BSP_UART3_RX_USING_DMA
65-
bool "Enable UART3 RX DMA"
66-
depends on BSP_USING_UART3
67-
select RT_SERIAL_USING_DMA
68-
default n
69-
70-
config BSP_USING_UART4
71-
bool "Enable UART4"
72-
default n
73-
74-
config BSP_UART4_RX_USING_DMA
75-
bool "Enable UART4 RX DMA"
76-
depends on BSP_USING_UART4
77-
select RT_SERIAL_USING_DMA
78-
default n
7959
endif
8060

8161
menuconfig BSP_USING_PWM
@@ -103,14 +83,21 @@ menu "On-chip Peripheral Drivers"
10383
menuconfig BSP_USING_WDT
10484
bool "Enable WDT"
10585
default n
106-
select RT_USING_WDT
10786
if BSP_USING_WDT
10887
config BSP_USING_FWDT
10988
bool "Enable FWDT"
11089
default y
11190
config BSP_USING_WWDT
11291
bool "Enable WWDT"
11392
default n
93+
choice
94+
prompt "Select WDT type"
95+
default BSP_USING_FWDT
96+
config BSP_USING_FWDT
97+
bool "Enable FWDT"
98+
config BSP_USING_WWDT
99+
bool "Enable WWDT"
100+
endchoice
114101
endif
115102

116103
source "$(BSP_DIR)/../libraries/gd32_drivers/Kconfig"

bsp/gd32/risc-v/libraries/gd32_drivers/drv_wdt.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
#include <board.h>
1212
#include <rtthread.h>
13-
14-
15-
16-
1713
#ifdef RT_USING_WDT
1814

1915
#if defined(BSP_USING_FWDT)
@@ -121,7 +117,7 @@ int fwdt_test_sample()
121117
LOG_D("find fwdt device success,device=%x",hw_dev);
122118
if (hw_dev == RT_NULL)
123119
{
124-
LOG_D("hwtimer sample run failed! can't find %s device!", HW_WDGT_DEV_NAME);
120+
LOG_D("fwdt sample run failed! can't find %s device!", HW_WDGT_DEV_NAME);
125121
return -RT_ERROR;
126122
}
127123
ret = rt_device_open(hw_dev, RT_DEVICE_OFLAG_RDWR);
@@ -140,6 +136,7 @@ int fwdt_test_sample()
140136
}
141137
rt_device_control(hw_dev, RT_DEVICE_CTRL_WDT_START, RT_NULL);
142138
rt_device_control(hw_dev, RT_DEVICE_CTRL_WDT_KEEPALIVE, RT_NULL);
139+
return ret;
143140
}
144141

145142
MSH_CMD_EXPORT(fwdt_test_sample, fwdt timeout 4 sec reset)
@@ -155,7 +152,7 @@ int wwdt_test_sample()
155152
LOG_D("find wwdt device success,device=%x",hw_dev);
156153
if (hw_dev == RT_NULL)
157154
{
158-
LOG_D("hwtimer sample run failed! can't find %s device!", HW_WDGT_DEV_NAME);
155+
LOG_D("wwdt sample run failed! can't find %s device!", HW_WDGT_DEV_NAME);
159156
return -RT_ERROR;
160157
}
161158
ret = rt_device_open(hw_dev, RT_DEVICE_OFLAG_RDWR);
@@ -174,6 +171,7 @@ int wwdt_test_sample()
174171
}
175172
rt_device_control(hw_dev, RT_DEVICE_CTRL_WDT_START, RT_NULL);
176173
rt_device_control(hw_dev, RT_DEVICE_CTRL_WDT_KEEPALIVE, RT_NULL);
174+
return ret;
177175
}
178176
MSH_CMD_EXPORT(wwdt_test_sample, wwdt timeout 40 msec reset)
179177
#endif

0 commit comments

Comments
 (0)