Skip to content

Commit 2263b62

Browse files
committed
[add] 移除不需要的文件并设配pin设备
1 parent f3bf126 commit 2263b62

File tree

9 files changed

+87
-239
lines changed

9 files changed

+87
-239
lines changed

bsp/gd32/risc-v/gd32vw553h-eval/.config

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ CONFIG_RT_HOOK_USING_FUNC_PTR=y
126126
# CONFIG_RT_USING_HOOKLIST is not set
127127
CONFIG_RT_USING_IDLE_HOOK=y
128128
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
129-
CONFIG_IDLE_THREAD_STACK_SIZE=1024
129+
CONFIG_IDLE_THREAD_STACK_SIZE=512
130130
CONFIG_RT_USING_TIMER_SOFT=y
131131
CONFIG_RT_TIMER_THREAD_PRIO=4
132132
CONFIG_RT_TIMER_THREAD_STACK_SIZE=512
@@ -202,22 +202,7 @@ CONFIG_RT_MAIN_THREAD_PRIORITY=10
202202
#
203203
# DFS: device virtual file system
204204
#
205-
CONFIG_RT_USING_DFS=y
206-
CONFIG_DFS_USING_POSIX=y
207-
CONFIG_DFS_USING_WORKDIR=y
208-
# CONFIG_RT_USING_DFS_MNTTABLE is not set
209-
CONFIG_DFS_FD_MAX=16
210-
CONFIG_RT_USING_DFS_V1=y
211-
# CONFIG_RT_USING_DFS_V2 is not set
212-
CONFIG_DFS_FILESYSTEMS_MAX=4
213-
CONFIG_DFS_FILESYSTEM_TYPES_MAX=4
214-
# CONFIG_RT_USING_DFS_ELMFAT is not set
215-
CONFIG_RT_USING_DFS_DEVFS=y
216-
# CONFIG_RT_USING_DFS_ROMFS is not set
217-
# CONFIG_RT_USING_DFS_CROMFS is not set
218-
# CONFIG_RT_USING_DFS_RAMFS is not set
219-
# CONFIG_RT_USING_DFS_TMPFS is not set
220-
# CONFIG_RT_USING_DFS_MQUEUE is not set
205+
# CONFIG_RT_USING_DFS is not set
221206
# end of DFS: device virtual file system
222207

223208
# CONFIG_RT_USING_FAL is not set

bsp/gd32/risc-v/gd32vw553h-eval/applications/main.c

Lines changed: 11 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -12,90 +12,24 @@
1212
#include <rtthread.h>
1313
#include <rtdevice.h>
1414
#include <board.h>
15-
#include "gd32vw553h_eval.h"
1615

17-
static rt_thread_t tid1 = RT_NULL;
18-
static rt_thread_t tid2 = RT_NULL;
19-
static rt_thread_t tid3 = RT_NULL;
20-
21-
static void rv_test1_entry(void *parameter)
22-
{
23-
while (1)
24-
{
25-
gd_eval_led_on(LED1);
26-
rt_thread_mdelay(500);
27-
/* turn off LEDs */
28-
gd_eval_led_off(LED1);;
29-
rt_thread_mdelay(500);
30-
}
31-
}
32-
33-
static void rv_test2_entry(void *parameter)
34-
{
35-
while (1)
36-
{
37-
gd_eval_led_on(LED2);
38-
rt_thread_mdelay(1000);
39-
/* turn off LEDs */
40-
gd_eval_led_off(LED2);
41-
rt_thread_mdelay(1000);
42-
}
43-
}
44-
45-
static void rv_test3_entry(void *parameter)
46-
{
47-
while (1)
48-
{
49-
gd_eval_led_on(LED3);
50-
rt_thread_mdelay(1500);
51-
/* turn off LEDs */
52-
gd_eval_led_off(LED3);
53-
rt_thread_mdelay(1500);
54-
}
55-
}
16+
/* defined the LED1 pin: PA4 */
17+
#define LED1_PIN GET_PIN(A, 4)
5618

5719
int main(void)
5820
{
59-
gd_eval_led_init(LED1);
60-
gd_eval_led_init(LED2);
61-
gd_eval_led_init(LED3);
62-
63-
tid1 = rt_thread_create("test1",
64-
rv_test1_entry,
65-
RT_NULL,
66-
512,
67-
15,
68-
20);
69-
if (tid1 != RT_NULL)
70-
{
71-
rt_thread_startup(tid1);
72-
}
73-
74-
tid2 = rt_thread_create("test2",
75-
rv_test2_entry,
76-
RT_NULL,
77-
512,
78-
15,
79-
20);
80-
if (tid2 != RT_NULL)
81-
{
82-
rt_thread_startup(tid2);
83-
}
21+
int count = 1;
8422

23+
/* set LED1 pin mode to output */
24+
rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
8525

86-
tid3 = rt_thread_create("test3",
87-
rv_test3_entry,
88-
RT_NULL,
89-
512,
90-
15,
91-
20);
92-
if (tid3 != RT_NULL)
26+
while (count++)
9327
{
94-
rt_thread_startup(tid3);
28+
rt_pin_write(LED1_PIN, PIN_HIGH);
29+
rt_thread_mdelay(500);
30+
rt_pin_write(LED1_PIN, PIN_LOW);
31+
rt_thread_mdelay(500);
9532
}
9633

97-
// while (1)
98-
// {
99-
// rt_schedule();
100-
// }
34+
return RT_EOK;
10135
}

bsp/gd32/risc-v/gd32vw553h-eval/board/board.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#ifndef __BOARD__
1212
#define __BOARD__
1313
#include "gd32vw55x.h"
14-
// #include "drv_gpio.h"
14+
#include "drv_gpio.h"
1515
extern void *_end;
1616
extern void *_heap_end;
1717
#define HEAP_BEGIN &_end

bsp/gd32/risc-v/gd32vw553h-eval/board/systick.c

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

bsp/gd32/risc-v/gd32vw553h-eval/board/systick.h

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

bsp/gd32/risc-v/gd32vw553h-eval/rtconfig.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
#define RT_HOOK_USING_FUNC_PTR
7373
#define RT_USING_IDLE_HOOK
7474
#define RT_IDLE_HOOK_LIST_SIZE 4
75-
#define IDLE_THREAD_STACK_SIZE 1024
75+
#define IDLE_THREAD_STACK_SIZE 512
7676
#define RT_USING_TIMER_SOFT
7777
#define RT_TIMER_THREAD_PRIO 4
7878
#define RT_TIMER_THREAD_STACK_SIZE 512
@@ -119,14 +119,6 @@
119119

120120
/* DFS: device virtual file system */
121121

122-
#define RT_USING_DFS
123-
#define DFS_USING_POSIX
124-
#define DFS_USING_WORKDIR
125-
#define DFS_FD_MAX 16
126-
#define RT_USING_DFS_V1
127-
#define DFS_FILESYSTEMS_MAX 4
128-
#define DFS_FILESYSTEM_TYPES_MAX 4
129-
#define RT_USING_DFS_DEVFS
130122
/* end of DFS: device virtual file system */
131123

132124
/* Device Drivers */

bsp/gd32/risc-v/libraries/GD32VW55x_Firmware_Library/SConscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ GD32VW55x_standard_peripheral/Source/gd32vw55x_gpio.c
1616
GD32VW55x_standard_peripheral/Source/gd32vw55x_rcu.c
1717
GD32VW55x_standard_peripheral/Source/gd32vw55x_exti.c
1818
GD32VW55x_standard_peripheral/Source/gd32vw55x_eclic.c
19+
GD32VW55x_standard_peripheral/Source/gd32vw55x_syscfg.c
1920
''')
2021

2122
if GetDepend(['RT_USING_SERIAL']):

0 commit comments

Comments
 (0)