Skip to content

Commit f6c8e39

Browse files
committed
Merge pull request #309 from BernardXiong/stable-v1.2.x
prepare RT-Thread 1.2.2 release
2 parents 350b108 + ea598b9 commit f6c8e39

File tree

16 files changed

+96
-56
lines changed

16 files changed

+96
-56
lines changed

bsp/beaglebone/drivers/serial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ int rt_hw_serial_init(void)
426426
config.stop_bits = STOP_BITS_1;
427427
config.invert = NRZ_NORMAL;
428428
serial3.ops = &am33xx_uart_ops;
429-
serial3.int_rx = &uart_3_int_rx;
429+
serial3.int_rx = &uart3_int_rx;
430430
serial3.config = config;
431431
/* enable RX interrupt */
432432
UART_IER_REG(uart3.base) = 0x01;
@@ -470,7 +470,7 @@ int rt_hw_serial_init(void)
470470
config.parity = PARITY_NONE;
471471
config.stop_bits = STOP_BITS_1;
472472
config.invert = NRZ_NORMAL;
473-
473+
474474
serial5.ops = &am33xx_uart_ops;
475475
serial5.int_rx = &uart5_int_rx;
476476
serial5.config = config;

bsp/stm32f40x/drivers/usart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ static void GPIO_Configuration(void)
165165
GPIO_Init(UART3_GPIO, &GPIO_InitStructure);
166166

167167
/* Connect alternate function */
168-
GPIO_PinAFConfig(UART2_GPIO, UART3_TX_PIN_SOURCE, GPIO_AF_USART3);
169-
GPIO_PinAFConfig(UART2_GPIO, UART3_RX_PIN_SOURCE, GPIO_AF_USART3);
168+
GPIO_PinAFConfig(UART3_GPIO, UART3_TX_PIN_SOURCE, GPIO_AF_USART3);
169+
GPIO_PinAFConfig(UART3_GPIO, UART3_RX_PIN_SOURCE, GPIO_AF_USART3);
170170
#endif
171171
}
172172

components/dfs/src/dfs_file.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,15 @@ static void copyfile(const char *src, const char *dst)
629629
read_bytes = dfs_file_read(&src_fd, block_ptr, BUF_SZ);
630630
if (read_bytes > 0)
631631
{
632-
dfs_file_write(&fd, block_ptr, read_bytes);
632+
int length;
633+
634+
length = dfs_file_write(&fd, block_ptr, read_bytes);
635+
if (length != read_bytes)
636+
{
637+
/* write failed. */
638+
rt_kprintf("Write file data failed, errno=%d\n", length);
639+
break;
640+
}
633641
}
634642
} while (read_bytes > 0);
635643

components/libc/newlib/syscalls.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
#include <sys/time.h>
44
#include <rtthread.h>
55

6+
#ifdef RT_USING_DFS
7+
#include <dfs_posix.h>
8+
#endif
9+
10+
#ifdef RT_USING_PTHREADS
11+
#include <pthread.h>
12+
#endif
13+
614
/* Reentrant versions of system calls. */
715

816
int

components/pthreads/pthread_cond.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
9898

9999
rt_snprintf(cond_name, sizeof(cond_name), "cond%02d", cond_num++);
100100

101-
cond->attr = *attr;
101+
if (attr == RT_NULL) /* use default value */
102+
cond->attr = PTHREAD_PROCESS_PRIVATE;
103+
else
104+
cond->attr = *attr;
105+
102106
result = rt_sem_init(&cond->sem, cond_name, 0, RT_IPC_FLAG_FIFO);
103107
if (result != RT_EOK)
104108
return EINVAL;

libcpu/arm/cortex-m0/context_gcc.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ _reswitch:
7979
STR R1, [R0]
8080
BX LR
8181

82-
/* R0 --> swith from thread stack
83-
* R1 --> swith to thread stack
82+
/* R0 --> switch from thread stack
83+
* R1 --> switch to thread stack
8484
* psr, pc, LR, R12, R3, R2, R1, R0 are pushed into [from] stack
8585
*/
8686
.global PendSV_Handler
@@ -103,7 +103,7 @@ PendSV_Handler:
103103
LDR R0, =rt_interrupt_from_thread
104104
LDR R1, [R0]
105105
CMP R1, #0x00
106-
BEQ swtich_to_thread /* skip register save at the first time */
106+
BEQ switch_to_thread /* skip register save at the first time */
107107

108108
MRS R1, PSP /* get from thread stack pointer */
109109

@@ -118,7 +118,7 @@ PendSV_Handler:
118118
MOV R6, R10
119119
MOV R7, R11
120120
STMIA R1!, {R4 - R7} /* push thread {R8 - R11} high register to thread stack */
121-
swtich_to_thread:
121+
switch_to_thread:
122122
LDR R1, =rt_interrupt_to_thread
123123
LDR R1, [R1]
124124
LDR R1, [R1] /* load thread stack pointer */

libcpu/arm/cortex-m0/context_iar.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ _reswitch
8181
STR r1, [r0]
8282
BX LR
8383

84-
; r0 --> swith from thread stack
85-
; r1 --> swith to thread stack
84+
; r0 --> switch from thread stack
85+
; r1 --> switch to thread stack
8686
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
8787
EXPORT PendSV_Handler
8888
PendSV_Handler:
@@ -104,7 +104,7 @@ PendSV_Handler:
104104
LDR r0, =rt_interrupt_from_thread
105105
LDR r1, [r0]
106106
CMP r1, #0x00
107-
BEQ swtich_to_thread ; skip register save at the first time
107+
BEQ switch_to_thread ; skip register save at the first time
108108

109109
MRS r1, psp ; get from thread stack pointer
110110

@@ -120,7 +120,7 @@ PendSV_Handler:
120120
MOV r7, r11
121121
STMIA r1!, {r4 - r7} ; push thread {r8 - r11} high register to thread stack
122122

123-
swtich_to_thread
123+
switch_to_thread
124124
LDR r1, =rt_interrupt_to_thread
125125
LDR r1, [r1]
126126
LDR r1, [r1] ; load thread stack pointer

libcpu/arm/cortex-m0/context_rvds.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ _reswitch
8585
BX LR
8686
ENDP
8787

88-
; r0 --> swith from thread stack
89-
; r1 --> swith to thread stack
88+
; r0 --> switch from thread stack
89+
; r1 --> switch to thread stack
9090
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
9191
PendSV_Handler PROC
9292
EXPORT PendSV_Handler
@@ -108,7 +108,7 @@ PendSV_Handler PROC
108108
LDR r0, =rt_interrupt_from_thread
109109
LDR r1, [r0]
110110
CMP r1, #0x00
111-
BEQ swtich_to_thread ; skip register save at the first time
111+
BEQ switch_to_thread ; skip register save at the first time
112112

113113
MRS r1, psp ; get from thread stack pointer
114114

@@ -124,7 +124,7 @@ PendSV_Handler PROC
124124
MOV r7, r11
125125
STMIA r1!, {r4 - r7} ; push thread {r8 - r11} high register to thread stack
126126

127-
swtich_to_thread
127+
switch_to_thread
128128
LDR r1, =rt_interrupt_to_thread
129129
LDR r1, [r1]
130130
LDR r1, [r1] ; load thread stack pointer

libcpu/arm/cortex-m3/context_gcc.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ _reswitch:
8080
STR R1, [R0]
8181
BX LR
8282

83-
/* R0 --> swith from thread stack
84-
* R1 --> swith to thread stack
83+
/* R0 --> switch from thread stack
84+
* R1 --> switch to thread stack
8585
* psr, pc, LR, R12, R3, R2, R1, R0 are pushed into [from] stack
8686
*/
8787
.global PendSV_Handler
@@ -102,14 +102,14 @@ PendSV_Handler:
102102

103103
LDR R0, =rt_interrupt_from_thread
104104
LDR R1, [R0]
105-
CBZ R1, swtich_to_thread /* skip register save at the first time */
105+
CBZ R1, switch_to_thread /* skip register save at the first time */
106106

107107
MRS R1, PSP /* get from thread stack pointer */
108108
STMFD R1!, {R4 - R11} /* push R4 - R11 register */
109109
LDR R0, [R0]
110110
STR R1, [R0] /* update from thread stack pointer */
111111

112-
swtich_to_thread:
112+
switch_to_thread:
113113
LDR R1, =rt_interrupt_to_thread
114114
LDR R1, [R1]
115115
LDR R1, [R1] /* load thread stack pointer */

libcpu/arm/cortex-m3/context_iar.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ _reswitch
8181
STR r1, [r0]
8282
BX LR
8383

84-
; r0 --> swith from thread stack
85-
; r1 --> swith to thread stack
84+
; r0 --> switch from thread stack
85+
; r1 --> switch to thread stack
8686
; psr, pc, lr, r12, r3, r2, r1, r0 are pushed into [from] stack
8787
EXPORT PendSV_Handler
8888
PendSV_Handler:
@@ -102,14 +102,14 @@ PendSV_Handler:
102102

103103
LDR r0, =rt_interrupt_from_thread
104104
LDR r1, [r0]
105-
CBZ r1, swtich_to_thread ; skip register save at the first time
105+
CBZ r1, switch_to_thread ; skip register save at the first time
106106

107107
MRS r1, psp ; get from thread stack pointer
108108
STMFD r1!, {r4 - r11} ; push r4 - r11 register
109109
LDR r0, [r0]
110110
STR r1, [r0] ; update from thread stack pointer
111111

112-
swtich_to_thread
112+
switch_to_thread
113113
LDR r1, =rt_interrupt_to_thread
114114
LDR r1, [r1]
115115
LDR r1, [r1] ; load thread stack pointer

0 commit comments

Comments
 (0)