summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-11-13 15:21:01 +0000
committer[email protected] <[email protected]>2012-11-13 15:21:01 +0000
commitd48ef70ecd46acf9e104befed50b42699d3824cc (patch)
tree68000464881cc63a0d467bb8665fb9a8b826450b /components
parentee2344c582e08135abddf74e398fb2d630107227 (diff)
In stm32fx's stm32_rom.ld, add symbol - '_stext' to support lua a. Update lua's README.TXT
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2410 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
-rw-r--r--components/external/lua/README.TXT9
-rw-r--r--components/libc/newlib/syscalls.c13
2 files changed, 11 insertions, 11 deletions
diff --git a/components/external/lua/README.TXT b/components/external/lua/README.TXT
index bfe8db60b3..d983056198 100644
--- a/components/external/lua/README.TXT
+++ b/components/external/lua/README.TXT
@@ -2,7 +2,7 @@
## 简介
RT-Thread中的Lua修改自[eLua](http://www.eluaproject.net/)的Lua-5.1.4版本。
-Lua依赖于Neblib库。
+采用gcc工具链时,Lua依赖于newlib库,其它工具链暂时还不支持。
启动lua的RAM占用情况
- 标准的lua 17.1904296875 KB
- 优化的lua 5.01953125 KB
@@ -24,13 +24,14 @@ Lua依赖于Neblib库。
3.更多的配置项可以在luaconf.h中找到
## 开发相关
+ - 采用gcc工具链时,依赖于newlib,需在rtconfig.h中定义RT_USING_NEWLIB
- 开启编译器对C99的支持,如MDK中,在C/C++选项的Misc Controls输入框中添加--c99
- - 开启内存优化时:需要在链接脚本中定义_stext和_etext,.ordata*放在两者之间。
+ - 需要在链接脚本中定义_stext和_etext,.ordata*放在两者之间。
用于判断数据是read-only和writable。MDK中如何实现??
- - 添加新的模块,参见larduinolib.c
+ - 添加新的模块,参见lexample.c
## 目录说明
- lua:从eLua获得Lua-5.1.4版本代码
- - exlibs:external libraries,外部库代码,如Arduino库
+ - exlibs:external libraries,外部库代码,如example库
- applications:Lua应用代码,如finsh中lua()
- test:测试代码
diff --git a/components/libc/newlib/syscalls.c b/components/libc/newlib/syscalls.c
index 6f670c8ef2..4405c5ce71 100644
--- a/components/libc/newlib/syscalls.c
+++ b/components/libc/newlib/syscalls.c
@@ -197,7 +197,6 @@ _wait_r(struct _reent *ptr, int *status)
_ssize_t
_write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes)
{
-#ifndef RT_USING_DFS
if (fd < 3)
{
rt_device_t console_device;
@@ -207,13 +206,13 @@ _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes)
if (console_device != 0) rt_device_write(console_device, 0, buf, nbytes);
return nbytes;
}
- return 0;
-#else
- _ssize_t rc;
+ else
+ {
+ _ssize_t rc;
- rc = write(fd, buf, nbytes);
- return rc;
-#endif
+ rc = write(fd, buf, nbytes);
+ return rc;
+ }
}
#endif