Skip to content

Commit 8e43999

Browse files
committed
Prepare for RT-Thread 1.2.4 release.
1 parent 7e871b0 commit 8e43999

File tree

10 files changed

+46
-7
lines changed

10 files changed

+46
-7
lines changed

components/dfs/filesystems/devfs/devfs.h

+1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
#include <rtthread.h>
2828

2929
int devfs_init(void);
30+
void rt_console_init(const char* device_name);
3031

3132
#endif

components/finsh/msh_cmd.c

+4
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ int cmd_free(int argc, char** argv)
211211
{
212212
extern void list_mem(void);
213213

214+
#ifdef RT_USING_MEMHEAP_AS_HEAP
215+
list_memheap();
216+
#else
214217
list_mem();
218+
#endif
215219
return 0;
216220
}
217221
FINSH_FUNCTION_EXPORT_ALIAS(cmd_free, __cmd_free, Show the memory usage in the system.);

components/libc/armlibc/stubs.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
168168

169169
console_device = rt_console_get_device();
170170
if (console_device != 0) rt_device_write(console_device, 0, buf, len);
171-
return len;
171+
172+
return 0;
172173
#endif
173174
}
174175

components/libc/minilibc/stdlib.c

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ long int atol(const char* s)
5454
return sign?-v:v;
5555
}
5656

57+
#ifdef RT_USING_HEAP
5758
void *malloc(size_t size)
5859
{
5960
return rt_malloc(size);
@@ -73,5 +74,6 @@ void *calloc(size_t nelem, size_t elsize)
7374
{
7475
return rt_calloc(nelem, elsize);
7576
}
77+
#endif
7678

7779
#endif

components/libc/newlib/libc.c

+13-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
#include <pthread.h>
1010
#endif
1111

12+
#ifdef RT_USING_DFS
13+
#include <dfs_posix.h>
14+
15+
#ifdef RT_USING_DFS_DEVFS
16+
#include <devfs.h>
17+
#endif
18+
19+
#endif
20+
1221
void libc_system_init(const char* tty_name)
1322
{
1423
#ifdef RT_USING_DFS
@@ -18,13 +27,16 @@ void libc_system_init(const char* tty_name)
1827
#error Please enable devfs by defining RT_USING_DFS_DEVFS in rtconfig.h
1928
#endif
2029

21-
/* init console device */
30+
/* initialize console device */
2231
rt_console_init(tty_name);
2332

2433
/* open console as stdin/stdout/stderr */
2534
fd = open("/dev/console", O_RDONLY, 0); /* for stdin */
2635
fd = open("/dev/console", O_WRONLY, 0); /* for stdout */
2736
fd = open("/dev/console", O_WRONLY, 0); /* for stderr */
37+
38+
/* skip warning */
39+
fd = fd;
2840
#endif
2941

3042
/* set PATH and HOME */

components/utilities/ymodem/ymodem.c

+12-1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,18 @@ static rt_err_t _rym_trans_data(
174174
return -RYM_ERR_SEQ;
175175
}
176176

177+
/* As we are sending C continuously, there is a chance that the
178+
* sender(remote) receive an C after sending the first handshake package.
179+
* So the sender will interpret it as NAK and re-send the package. So we
180+
* just ignore it and proceed. */
181+
if (ctx->stage == RYM_STAGE_ESTABLISHED && ctx->buf[1] == 0x00)
182+
{
183+
*code = RYM_CODE_NONE;
184+
return RT_EOK;
185+
}
186+
187+
ctx->stage = RYM_STAGE_TRANSMITTING;
188+
177189
/* sanity check */
178190
recv_crc = (rt_uint16_t)(*(ctx->buf+tsz-1) << 8) | *(ctx->buf+tsz);
179191
if (recv_crc != CRC16(ctx->buf+3, data_sz))
@@ -214,7 +226,6 @@ static rt_err_t _rym_do_trans(struct rym_ctx *ctx)
214226
default:
215227
return -RYM_ERR_CODE;
216228
};
217-
ctx->stage = RYM_STAGE_TRANSMITTING;
218229

219230
err = _rym_trans_data(ctx, data_sz, &code);
220231
if (err != RT_EOK)

components/utilities/ymodem/ymodem.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ enum rym_code {
5252
#endif
5353
/* how many ticks between two handshake code. */
5454
#ifndef RYM_CHD_INTV_TICK
55-
#define RYM_CHD_INTV_TICK (RT_TICK_PER_SECOND / 4)
55+
#define RYM_CHD_INTV_TICK (RT_TICK_PER_SECOND * 3)
56+
#endif
57+
58+
/* how many CAN be sent when user active end the session. */
59+
#ifndef RYM_END_SESSION_SEND_CAN_NUM
60+
#define RYM_END_SESSION_SEND_CAN_NUM 0x07
5661
#endif
5762

5863
enum rym_stage {
@@ -61,7 +66,8 @@ enum rym_stage {
6166
RYM_STAGE_ESTABLISHING,
6267
/* set when we've got the packet 0 and sent ACK and second C */
6368
RYM_STAGE_ESTABLISHED,
64-
/* set when the sender respond to our second C */
69+
/* set when the sender respond to our second C and recviever got a real
70+
* data packet. */
6571
RYM_STAGE_TRANSMITTING,
6672
/* set when the sender send a EOT */
6773
RYM_STAGE_FINISHING,

include/rtdef.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern "C" {
5050
/* RT-Thread version information */
5151
#define RT_VERSION 1L /**< major version number */
5252
#define RT_SUBVERSION 2L /**< minor version number */
53-
#define RT_REVISION 3L /**< revise version number */
53+
#define RT_REVISION 4L /**< revise version number */
5454

5555
/* RT-Thread version */
5656
#define RTTHREAD_VERSION ((RT_VERSION * 10000) + \

src/memheap.c

+2
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ void rt_memheap_free(void *ptr)
517517

518518
/* check magic */
519519
RT_ASSERT((header_ptr->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
520+
/* check whether this block of memory has been over-written. */
521+
RT_ASSERT((header_ptr->next->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
520522

521523
/* get pool ptr */
522524
heap = header_ptr->pool_ptr;

src/module.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static struct rt_module_symtab *_rt_module_symtab_end = RT_NULL;
8282
*/
8383
int rt_system_module_init(void)
8484
{
85-
#ifdef __GNUC__
85+
#if defined(__GNUC__) && !defined(__CC_ARM)
8686
extern int __rtmsymtab_start;
8787
extern int __rtmsymtab_end;
8888

0 commit comments

Comments
 (0)