Skip to content

Commit a8037b9

Browse files
authored
Merge pull request #4541 from mysterywolf/rx2
[rx] auto formatted
2 parents 85e81c4 + b88e579 commit a8037b9

File tree

5 files changed

+80
-80
lines changed

5 files changed

+80
-80
lines changed

bsp/rx/applications/startup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int main(void)
9090
{
9191

9292
rt_hw_system_freq_init();
93-
93+
9494
__enable_interrupt();
9595
/* disable interrupt first */
9696
rt_hw_interrupt_disable();

bsp/rx/drivers/board.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
*/
1919
#pragma vector = VECT_CMT0_CMI0
20-
__interrupt
20+
__interrupt
2121
void SysTick_Handler(void)
2222
{
2323
// __enable_interrupt();
@@ -56,7 +56,7 @@ void rt_hw_systick_init(void)
5656
}
5757

5858
void rt_hw_system_freq_init(void)
59-
{
59+
{
6060
/* Declare error flag */
6161
bool err = true;
6262

@@ -69,15 +69,15 @@ void rt_hw_system_freq_init(void)
6969
24E6,
7070
PDL_NO_DATA
7171
);
72-
/*
72+
/*
7373
Clock Description Frequency
7474
----------------------------------------
7575
Input Clock Frequency..............12MHz
76-
Internal Clock Frequency...........96MHz
76+
Internal Clock Frequency...........96MHz
7777
Peripheral Clock Frequency.........48MHz
7878
External Bus Clock Frequency.......24MHz */
7979

80-
/* Halt in while loop when RPDL errors detected */
80+
/* Halt in while loop when RPDL errors detected */
8181
while (!err);
8282
}
8383

@@ -86,8 +86,8 @@ void rt_hw_system_freq_init(void)
8686
*/
8787
void rt_hw_board_init()
8888
{
89-
90-
rt_hw_system_freq_init();
89+
90+
rt_hw_system_freq_init();
9191
rt_hw_systick_init();
9292
rt_hw_uart_init();
9393
#ifdef RT_USING_CONSOLE

bsp/rx/drivers/board.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#define __BOARD_H__
33

44

5-
#define XTAL_FREQUENCY (12000000L)
6-
#define ICLK_MUL (8)
7-
#define PCLK_MUL (4)
8-
#define BCLK_MUL (2)
5+
#define XTAL_FREQUENCY (12000000L)
6+
#define ICLK_MUL (8)
7+
#define PCLK_MUL (4)
8+
#define BCLK_MUL (2)
99

1010
#define RX62N_SRAM_END 0x0000ffff
1111

bsp/rx/drivers/uart.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222

2323

2424
/* Clock selection control */
25-
#define SCI_CKS_MIN 0
26-
#define SCI_CKS_MAX 3
27-
#define SCI_CKS_STEP 1
25+
#define SCI_CKS_MIN 0
26+
#define SCI_CKS_MAX 3
27+
#define SCI_CKS_STEP 1
2828

2929

30-
#define IPR_ADDRESS(a) ((volatile unsigned char *)&ICU.IPR[IPR_SCI0_ + a])
30+
#define IPR_ADDRESS(a) ((volatile unsigned char *)&ICU.IPR[IPR_SCI0_ + a])
3131
//#define IER_ADDRESS(a) ((volatile unsigned char *)&(ICU.IER[IER_SCI0_ERI0 + a])/sizeof(unsigned char))
32-
#define ERI_ADDRESS(a) ((volatile unsigned char *)&ICU.IR[IR_SCI0_ERI0] + ((4 * a) / sizeof(unsigned char)) )
33-
#define IER_ADDRESS(a) ((volatile unsigned char *)&ICU.IER[IER_SCI0_ERI0] + ((4 * a) / sizeof(unsigned char)) )
34-
#define RXI_ADDRESS(a) ((volatile unsigned char *)&ICU.IR[IR_SCI0_RXI0] + ((4 * a) / sizeof(unsigned char)) )
35-
#define TXI_ADDRESS(a) ((volatile unsigned char *)&ICU.IR[IR_SCI0_TXI0] + ((4 * a) / sizeof(unsigned char)) )
36-
#define TEI_ADDRESS(a) ((volatile unsigned char *)&ICU.IR[IR_SCI0_TEI0] + ((4 * a) / sizeof(unsigned char)) )
32+
#define ERI_ADDRESS(a) ((volatile unsigned char *)&ICU.IR[IR_SCI0_ERI0] + ((4 * a) / sizeof(unsigned char)) )
33+
#define IER_ADDRESS(a) ((volatile unsigned char *)&ICU.IER[IER_SCI0_ERI0] + ((4 * a) / sizeof(unsigned char)) )
34+
#define RXI_ADDRESS(a) ((volatile unsigned char *)&ICU.IR[IR_SCI0_RXI0] + ((4 * a) / sizeof(unsigned char)) )
35+
#define TXI_ADDRESS(a) ((volatile unsigned char *)&ICU.IR[IR_SCI0_TXI0] + ((4 * a) / sizeof(unsigned char)) )
36+
#define TEI_ADDRESS(a) ((volatile unsigned char *)&ICU.IR[IR_SCI0_TEI0] + ((4 * a) / sizeof(unsigned char)) )
3737
#define RXI_DTCER_ADDRESS(a) (( volatile unsigned char *)&ICU.DTCER[IR_SCI0_RXI0]+ ((4*a)/sizeof(unsigned char)))
3838
#define TXI_DTCER_ADDRESS(a) (( volatile unsigned char *)&ICU.DTCER[IR_SCI0_TXI0]+ ((4*a) / sizeof(unsigned char)))
3939
//#define SCI1_USE_B
@@ -44,8 +44,8 @@
4444
#define SourceClk 12000000
4545
#define rpdl_CGC_f_pclk SourceClk * 4
4646
/* Idle output options */
47-
#define SPACE 0
48-
#define MARK 1
47+
#define SPACE 0
48+
#define MARK 1
4949

5050
typedef int UART_ID_Type;
5151
typedef int IRQn_Type;
@@ -55,14 +55,14 @@ typedef int IRQn_Type;
5555
struct rx_uart
5656
{
5757
UART_ID_Type UART;
58-
volatile struct st_sci __sfr * sci;
58+
volatile struct st_sci __sfr * sci;
5959
};
6060

6161
static rt_err_t rx_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
6262
{
6363
#if 1
6464
struct rx_uart *uart;
65-
65+
6666
unsigned char smr_copy;
6767
unsigned char semr_copy;
6868
unsigned char scr_copy;
@@ -81,7 +81,7 @@ static rt_err_t rx_configure(struct rt_serial_device *serial, struct serial_conf
8181
semr_copy = 0x00u;
8282
scmr_copy = 0x72u;
8383
brr_divider = 0;
84-
84+
8585
switch (uart->UART) {
8686
case 0:
8787
SYSTEM.MSTPCRB.BIT.MSTPB31 = 0;
@@ -257,11 +257,11 @@ case 0:
257257
}
258258

259259
/*parity*/
260-
if (cfg->parity == PARITY_ODD)
260+
if (cfg->parity == PARITY_ODD)
261261
smr_copy |= BIT_5;
262-
else if (cfg->parity == PARITY_EVEN)
262+
else if (cfg->parity == PARITY_EVEN)
263263
smr_copy |= BIT_4 | BIT_5;
264-
264+
265265

266266

267267
brr_divider = rpdl_CGC_f_pclk / cfg->baud_rate;
@@ -304,13 +304,13 @@ case 0:
304304
}while (bit_interval_counter != 0);
305305

306306
scr_copy = 0x00u;
307-
307+
308308
/*enable rx an tx*/
309309
scr_copy |= BIT_5 | BIT_4 ;
310310

311311
uart->sci->SCR.BYTE &= 0x5B;
312312
uart->sci->SCR.BYTE |= scr_copy;
313-
313+
314314
*(IPR_ADDRESS(uart->UART)) = 5;
315315
uart->sci->SSR.BYTE = 0xC0;
316316
uart->sci->SSR.BYTE &= INV_BIT_5;
@@ -363,22 +363,22 @@ case 0:
363363
break;
364364
}
365365

366-
flag |= PDL_SCI_ASYNC |
367-
PDL_SCI_TX_CONNECTED |
368-
PDL_SCI_RX_CONNECTED |
366+
flag |= PDL_SCI_ASYNC |
367+
PDL_SCI_TX_CONNECTED |
368+
PDL_SCI_RX_CONNECTED |
369369
PDL_SCI_CLK_INT_IO ;
370370
/* Configure the RS232 port */
371371
err &= R_SCI_Create(
372372
uart->UART,
373373
flag,
374374
cfg->baud_rate,
375375
5);
376-
376+
377377
uart->sci->SCR.BYTE |= BIT_4|BIT_5;
378378

379379
__enable_interrupt();
380380
#endif
381-
381+
382382
switch (uart->UART) {
383383
case 0:
384384

@@ -430,7 +430,7 @@ case 0:
430430

431431
break;
432432
}
433-
433+
434434
return RT_EOK;
435435
}
436436

@@ -464,7 +464,7 @@ static int rx_putc(struct rt_serial_device *serial, char c)
464464
uart = (struct rx_uart *)serial->parent.user_data;
465465
while (uart->sci->SSR.BIT.TDRE == 0);
466466
uart->sci->TDR = c;
467-
return 1;
467+
return 1;
468468
}
469469

470470
static int rx_getc(struct rt_serial_device *serial)
@@ -528,15 +528,15 @@ void rt_hw_uart_init(void)
528528
config.parity = PARITY_NONE;
529529
config.stop_bits = STOP_BITS_1;
530530
config.invert = NRZ_NORMAL;
531-
config.bufsz = RT_SERIAL_RB_BUFSZ;
531+
config.bufsz = RT_SERIAL_RB_BUFSZ;
532532

533533
serial2.ops = &rx_uart_ops;
534534
serial2.config = config;
535535

536536
/* register UART1 device */
537537
rt_hw_serial_register(&serial2, "uart2",
538-
RT_DEVICE_FLAG_RDWR |
539-
RT_DEVICE_FLAG_INT_RX |
538+
RT_DEVICE_FLAG_RDWR |
539+
RT_DEVICE_FLAG_INT_RX |
540540
RT_DEVICE_FLAG_STREAM,
541541
uart);
542542
#endif

bsp/rx/rtconfig.h

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
#define __RTTHREAD_CFG_H__
44

55
/* RT_NAME_MAX*/
6-
#define RT_NAME_MAX 8
6+
#define RT_NAME_MAX 8
77

88
/* RT_ALIGN_SIZE*/
9-
#define RT_ALIGN_SIZE 4
9+
#define RT_ALIGN_SIZE 4
1010

1111
/* PRIORITY_MAX */
12-
#define RT_THREAD_PRIORITY_MAX 32
12+
#define RT_THREAD_PRIORITY_MAX 32
1313

1414
/* Tick per Second */
15-
#define RT_TICK_PER_SECOND 100
15+
#define RT_TICK_PER_SECOND 100
1616

1717
/* SECTION: RT_DEBUG */
1818
/* Thread Debug */
@@ -27,9 +27,9 @@
2727

2828
/* Using Software Timer */
2929
/* #define RT_USING_TIMER_SOFT */
30-
#define RT_TIMER_THREAD_PRIO 4
31-
#define RT_TIMER_THREAD_STACK_SIZE 512
32-
#define RT_TIMER_TICK_PER_SECOND 10
30+
#define RT_TIMER_THREAD_PRIO 4
31+
#define RT_TIMER_THREAD_STACK_SIZE 512
32+
#define RT_TIMER_TICK_PER_SECOND 10
3333

3434
/* SECTION: IPC */
3535
/* Using Semaphore*/
@@ -72,9 +72,9 @@
7272
/* SECTION: Console options */
7373
#define RT_USING_CONSOLE
7474
/* the buffer size of console*/
75-
#define RT_CONSOLEBUF_SIZE 128
75+
#define RT_CONSOLEBUF_SIZE 128
7676
// <string name="RT_CONSOLE_DEVICE_NAME" description="The device name for console" default="uart1" />
77-
#define RT_CONSOLE_DEVICE_NAME "uart2"
77+
#define RT_CONSOLE_DEVICE_NAME "uart2"
7878

7979
/* SECTION: finsh, a C-Express shell */
8080
#define RT_USING_FINSH
@@ -89,17 +89,17 @@
8989
/* Reentrancy (thread safe) of the FatFs module. */
9090
#define RT_DFS_ELM_REENTRANT
9191
/* Number of volumes (logical drives) to be used. */
92-
#define RT_DFS_ELM_DRIVES 2
93-
/* #define RT_DFS_ELM_USE_LFN 1 */
94-
/* #define RT_DFS_ELM_CODE_PAGE 936 */
95-
#define RT_DFS_ELM_MAX_LFN 255
92+
#define RT_DFS_ELM_DRIVES 2
93+
/* #define RT_DFS_ELM_USE_LFN 1 */
94+
/* #define RT_DFS_ELM_CODE_PAGE 936 */
95+
#define RT_DFS_ELM_MAX_LFN 255
9696
/* Maximum sector size to be handled. */
9797
#define RT_DFS_ELM_MAX_SECTOR_SIZE 512
9898

9999
/* the max number of mounted filesystem */
100-
#define DFS_FILESYSTEMS_MAX 2
101-
/* the max number of opened files */
102-
#define DFS_FD_MAX 4
100+
#define DFS_FILESYSTEMS_MAX 2
101+
/* the max number of opened files */
102+
#define DFS_FD_MAX 4
103103

104104
/* SECTION: lwip, a lighwight TCP/IP protocol stack */
105105
/* #define RT_USING_LWIP */
@@ -113,49 +113,49 @@
113113
#define RT_LWIP_DNS
114114

115115
/* the number of simulatenously active TCP connections*/
116-
#define RT_LWIP_TCP_PCB_NUM 5
116+
#define RT_LWIP_TCP_PCB_NUM 5
117117

118118
/* Using DHCP */
119119
/* #define RT_LWIP_DHCP */
120120

121121
/* ip address of target*/
122-
#define RT_LWIP_IPADDR0 192
123-
#define RT_LWIP_IPADDR1 168
124-
#define RT_LWIP_IPADDR2 1
125-
#define RT_LWIP_IPADDR3 30
122+
#define RT_LWIP_IPADDR0 192
123+
#define RT_LWIP_IPADDR1 168
124+
#define RT_LWIP_IPADDR2 1
125+
#define RT_LWIP_IPADDR3 30
126126

127127
/* gateway address of target*/
128-
#define RT_LWIP_GWADDR0 192
129-
#define RT_LWIP_GWADDR1 168
130-
#define RT_LWIP_GWADDR2 1
131-
#define RT_LWIP_GWADDR3 1
128+
#define RT_LWIP_GWADDR0 192
129+
#define RT_LWIP_GWADDR1 168
130+
#define RT_LWIP_GWADDR2 1
131+
#define RT_LWIP_GWADDR3 1
132132

133133
/* mask address of target*/
134-
#define RT_LWIP_MSKADDR0 255
135-
#define RT_LWIP_MSKADDR1 255
136-
#define RT_LWIP_MSKADDR2 255
137-
#define RT_LWIP_MSKADDR3 0
134+
#define RT_LWIP_MSKADDR0 255
135+
#define RT_LWIP_MSKADDR1 255
136+
#define RT_LWIP_MSKADDR2 255
137+
#define RT_LWIP_MSKADDR3 0
138138

139139
/* tcp thread options */
140-
#define RT_LWIP_TCPTHREAD_PRIORITY 12
141-
#define RT_LWIP_TCPTHREAD_MBOX_SIZE 10
142-
#define RT_LWIP_TCPTHREAD_STACKSIZE 1024
140+
#define RT_LWIP_TCPTHREAD_PRIORITY 12
141+
#define RT_LWIP_TCPTHREAD_MBOX_SIZE 10
142+
#define RT_LWIP_TCPTHREAD_STACKSIZE 1024
143143

144144
/* ethernet if thread options */
145-
#define RT_LWIP_ETHTHREAD_PRIORITY 15
146-
#define RT_LWIP_ETHTHREAD_MBOX_SIZE 10
147-
#define RT_LWIP_ETHTHREAD_STACKSIZE 512
145+
#define RT_LWIP_ETHTHREAD_PRIORITY 15
146+
#define RT_LWIP_ETHTHREAD_MBOX_SIZE 10
147+
#define RT_LWIP_ETHTHREAD_STACKSIZE 512
148148

149149
/* TCP sender buffer space */
150-
#define RT_LWIP_TCP_SND_BUF 8192
150+
#define RT_LWIP_TCP_SND_BUF 8192
151151
/* TCP receive window. */
152-
#define RT_LWIP_TCP_WND 8192
152+
#define RT_LWIP_TCP_WND 8192
153153

154154
/* SECTION: RT-Thread/GUI */
155155
/* #define RT_USING_RTGUI */
156156

157157
/* name length of RTGUI object */
158-
#define RTGUI_NAME_MAX 12
158+
#define RTGUI_NAME_MAX 12
159159
/* support 16 weight font */
160160
#define RTGUI_USING_FONT16
161161
/* support Chinese font */
@@ -171,7 +171,7 @@
171171
/* use mouse cursor */
172172
/* #define RTGUI_USING_MOUSE_CURSOR */
173173
/* default font size in RTGUI */
174-
#define RTGUI_DEFAULT_FONT_SIZE 16
174+
#define RTGUI_DEFAULT_FONT_SIZE 16
175175

176176
/* image support */
177177
/* #define RTGUI_IMAGE_XPM */

0 commit comments

Comments
 (0)