Skip to content

Commit c1f4d6c

Browse files
committed
修改license header,修改driver目录下的SConscript。
1 parent 7f330c7 commit c1f4d6c

File tree

15 files changed

+420
-285
lines changed

15 files changed

+420
-285
lines changed

bsp/bm3803/applications/board.c

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
/*
2-
* File : board.c
3-
* This file is part of RT-Thread RTOS
4-
* COPYRIGHT (C) 2020, Shenzhen Academy of Aerospace Technology
5-
*
6-
* The license and distribution terms for this file may be
7-
* found in the file LICENSE in this distribution or at
8-
* http://www.rt-thread.org/license/LICENSE
9-
*
10-
* Change Logs:
11-
* Date Author Notes
12-
* 2020-10-16 Dystopia the first version
13-
*/
2+
Copyright 2020 Shenzhen Academy of Aerospace Technology
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
Change Logs:
17+
Date Author Notes
18+
2020-10-16 Dystopia the first version
19+
*/
1420

1521
#include <rthw.h>
1622
#include <rtthread.h>
@@ -21,27 +27,27 @@
2127

2228
extern int __bss_end;
2329

24-
static void rt_hw_timer_isr(int vector, void* param)
30+
static void rt_hw_timer_isr(int vector, void *param)
2531
{
26-
rt_tick_increase();
27-
/* timer interrupt cleared by hardware */
32+
rt_tick_increase();
33+
/* timer interrupt cleared by hardware */
2834
}
2935

3036
int rt_hw_timer_init(void)
3137
{
32-
unsigned int counter = 1000000 / RT_TICK_PER_SECOND;
33-
volatile struct lregs *regs = (struct lregs*)PREGS;
34-
38+
unsigned int counter = 1000000 / RT_TICK_PER_SECOND;
39+
volatile struct lregs *regs = (struct lregs *)PREGS;
40+
3541
regs->scalercnt = CPU_FREQ / 1000000 - 1;
3642
regs->scalerload = CPU_FREQ / 1000000 - 1;
3743
regs->timercnt2 = counter - 1;
3844
regs->timerload2 = counter - 1;
3945

40-
rt_hw_interrupt_install(TIMER2_TT, rt_hw_timer_isr, RT_NULL, "tick");
41-
rt_hw_interrupt_umask(TIMER2_TT);
46+
rt_hw_interrupt_install(TIMER2_TT, rt_hw_timer_isr, RT_NULL, "tick");
47+
rt_hw_interrupt_umask(TIMER2_TT);
4248

43-
/* start timer */
44-
regs->timerctrl2 = 0x7;
49+
/* start timer */
50+
regs->timerctrl2 = 0x7;
4551

4652
return 0;
4753
}
@@ -52,7 +58,7 @@ INIT_BOARD_EXPORT(rt_hw_timer_init);
5258
*/
5359
void rt_hw_board_init(void)
5460
{
55-
rt_system_heap_init((void*)&__bss_end, (void*)&__bss_end + 0x01000000);
61+
rt_system_heap_init((void *)&__bss_end, (void *)&__bss_end + 0x01000000);
5662
rt_components_board_init();
57-
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
63+
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
5864
}

bsp/bm3803/applications/board.h

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
/*
2-
* File : board.h
3-
* This file is part of RT-Thread RTOS
4-
* COPYRIGHT (C) 2020, Shenzhen Academy of Aerospace Technology
5-
*
6-
* The license and distribution terms for this file may be
7-
* found in the file LICENSE in this distribution or at
8-
* http://www.rt-thread.org/license/LICENSE
9-
*
10-
* Change Logs:
11-
* Date Author Notes
12-
* 2020-10-16 Dystopia the first version
13-
*/
2+
Copyright 2020 Shenzhen Academy of Aerospace Technology
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
Change Logs:
17+
Date Author Notes
18+
2020-10-16 Dystopia the first version
19+
*/
1420

1521
#ifndef __BOARD_H__
1622
#define __BOARD_H__

bsp/bm3803/applications/main.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
/*
2+
Copyright 2020 Shenzhen Academy of Aerospace Technology
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
Change Logs:
17+
Date Author Notes
18+
2020-10-16 Dystopia the first version
19+
*/
20+
121
#include <stdint.h>
222
#include <stdio.h>
323
#include <stdlib.h>

bsp/bm3803/drivers/SConscript

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@ Import('RTT_ROOT')
33
Import('rtconfig')
44
from building import *
55

6-
cwd = GetCurrentDir()
6+
cwd = GetCurrentDir()
77
src = Glob('*.c')
8-
9-
# remove no need file.
10-
if GetDepend('RT_USING_LWIP') == False:
11-
src_need_remove = ['dm9000.c'] # need remove file list.
12-
SrcRemove(src, src_need_remove)
13-
14-
if GetDepend('RT_USING_DFS') == False:
15-
src_need_remove = ['sd.c'] # need remove file list.
16-
SrcRemove(src, src_need_remove)
17-
188
CPPPATH = [cwd]
19-
209
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
2110

2211
Return('group')

bsp/bm3803/drivers/uart.c

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
/*
2-
* File : serial.c
3-
* This file is part of RT-Thread RTOS
4-
* COPYRIGHT (C) 2020, Shenzhen Academy of Aerospace Technology
5-
*
6-
* The license and distribution terms for this file may be
7-
* found in the file LICENSE in this distribution or at
8-
* http://www.rt-thread.org/license/LICENSE
9-
*
10-
* Change Logs:
11-
* Date Author Notes
12-
* 2020-10-16 Dystopia the first version
13-
*/
2+
Copyright 2020 Shenzhen Academy of Aerospace Technology
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
Change Logs:
17+
Date Author Notes
18+
2020-10-16 Dystopia the first version
19+
*/
1420

1521
#include <rthw.h>
1622
#include <rtthread.h>
@@ -27,16 +33,16 @@ struct bm3803_uart
2733
int irq;
2834
};
2935

30-
static void bm3803_uart_isr(int tt, void* param)
36+
static void bm3803_uart_isr(int tt, void *param)
3137
{
32-
struct bm3803_uart* uart;
38+
struct bm3803_uart *uart;
3339
struct rt_serial_device *serial;
34-
struct uart_reg* uart_base;
40+
struct uart_reg *uart_base;
3541

36-
serial = (struct rt_serial_device*)param;
42+
serial = (struct rt_serial_device *)param;
3743
uart = (struct bm3803_uart *)serial->parent.user_data;
3844
uart_base = uart->uart_base;
39-
45+
4046
if (uart_base->uartstatus & 0x1)
4147
{
4248
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
@@ -47,8 +53,8 @@ static void bm3803_uart_isr(int tt, void* param)
4753

4854
static rt_err_t bm3803_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
4955
{
50-
struct bm3803_uart* uart;
51-
struct uart_reg* uart_base;
56+
struct bm3803_uart *uart;
57+
struct uart_reg *uart_base;
5258

5359
RT_ASSERT(serial != RT_NULL);
5460
uart = (struct bm3803_uart *)serial->parent.user_data;
@@ -57,25 +63,25 @@ static rt_err_t bm3803_configure(struct rt_serial_device *serial, struct serial_
5763

5864
if (cfg->baud_rate == BAUD_RATE_115200)
5965
{
60-
uart_base->uartscaler = ((((CPU_FREQ * 10) / (8 * 115200)) - 5) / 10);
66+
uart_base->uartscaler = ((((CPU_FREQ * 10) / (8 * 115200)) - 5) / 10);
6167
}
6268
else if (cfg->baud_rate == BAUD_RATE_9600)
6369
{
64-
uart_base->uartscaler = ((((CPU_FREQ * 10) / (8 * 9600)) - 5) / 10);
70+
uart_base->uartscaler = ((((CPU_FREQ * 10) / (8 * 9600)) - 5) / 10);
6571
}
6672
else
6773
{
6874
NOT_IMPLEMENTED();
6975
}
70-
76+
7177
uart_base->uartctrl |= 0x3;
7278

7379
return RT_EOK;
7480
}
7581

7682
static rt_err_t bm3803_control(struct rt_serial_device *serial, int cmd, void *arg)
7783
{
78-
struct bm3803_uart* uart;
84+
struct bm3803_uart *uart;
7985

8086
RT_ASSERT(serial != RT_NULL);
8187
uart = (struct bm3803_uart *)serial->parent.user_data;
@@ -97,13 +103,13 @@ static rt_err_t bm3803_control(struct rt_serial_device *serial, int cmd, void *a
97103

98104
static int bm3803_putc(struct rt_serial_device *serial, char c)
99105
{
100-
struct bm3803_uart* uart;
101-
struct uart_reg* uart_base;
102-
106+
struct bm3803_uart *uart;
107+
struct uart_reg *uart_base;
108+
103109
RT_ASSERT(serial != RT_NULL);
104110
uart = (struct bm3803_uart *)serial->parent.user_data;
105111
uart_base = uart->uart_base;
106-
112+
107113
while (!(uart_base->uartstatus & 0x4));
108114
uart_base->uartdata = c;
109115

@@ -113,13 +119,13 @@ static int bm3803_putc(struct rt_serial_device *serial, char c)
113119
static int bm3803_getc(struct rt_serial_device *serial)
114120
{
115121
int ch;
116-
struct bm3803_uart* uart;
117-
struct uart_reg* uart_base;
122+
struct bm3803_uart *uart;
123+
struct uart_reg *uart_base;
118124

119125
RT_ASSERT(serial != RT_NULL);
120126
uart = (struct bm3803_uart *)serial->parent.user_data;
121-
uart_base = uart->uart_base;
122-
127+
uart_base = uart->uart_base;
128+
123129
ch = -1;
124130
if (uart_base->uartstatus & 0x1)
125131
{
@@ -131,7 +137,7 @@ static int bm3803_getc(struct rt_serial_device *serial)
131137

132138
static const struct rt_uart_ops bm3803_uart_ops =
133139
{
134-
bm3803_configure,
140+
bm3803_configure,
135141
bm3803_control,
136142
bm3803_putc,
137143
bm3803_getc,
@@ -141,7 +147,7 @@ static const struct rt_uart_ops bm3803_uart_ops =
141147
#ifdef RT_USING_UART1
142148
struct bm3803_uart uart1 =
143149
{
144-
(void*)UART1_BASE,
150+
(void *)UART1_BASE,
145151
UART1_TT,
146152
};
147153
struct rt_serial_device serial1;
@@ -152,7 +158,7 @@ int rt_hw_serial_init(void)
152158
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
153159

154160
#ifdef RT_USING_UART1
155-
volatile struct lregs *regs = (struct lregs*)PREGS;
161+
volatile struct lregs *regs = (struct lregs *)PREGS;
156162
serial1.ops = &bm3803_uart_ops;
157163
serial1.config = config;
158164
/* configure gpio direction */
@@ -166,8 +172,8 @@ int rt_hw_serial_init(void)
166172
rt_hw_interrupt_mask(uart1.irq);
167173
/* register UART1 device */
168174
rt_hw_serial_register(&serial1, "uart1",
169-
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
170-
&uart1);
175+
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
176+
&uart1);
171177
#endif
172178
return 0;
173179
}

bsp/bm3803/drivers/uart.h

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
/*
2-
* File : serial.h
3-
* This file is part of RT-Thread RTOS
4-
* COPYRIGHT (C) 2020, Shenzhen Academy of Aerospace Technology
5-
*
6-
* The license and distribution terms for this file may be
7-
* found in the file LICENSE in this distribution or at
8-
* http://www.rt-thread.org/license/LICENSE
9-
*
10-
* Change Logs:
11-
* Date Author Notes
12-
* 2020-10-16 Dystopia the first version
13-
*/
2+
Copyright 2020 Shenzhen Academy of Aerospace Technology
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
Change Logs:
17+
Date Author Notes
18+
2020-10-16 Dystopia the first version
19+
*/
1420

1521
#ifndef __SERIAL_H__
1622
#define __SERIAL_H__

0 commit comments

Comments
 (0)