Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yunqingabc
rt-thread
提交
0ddc739a
R
rt-thread
项目概览
yunqingabc
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0ddc739a
编写于
7月 10, 2014
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some comments of lwip porting
上级
b51aff3e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
45 addition
and
1 deletion
+45
-1
bsp/mini2440/.dm9000.c.swp
bsp/mini2440/.dm9000.c.swp
+0
-0
components/net/lwip-1.4.1/src/arch/sys_arch.c
components/net/lwip-1.4.1/src/arch/sys_arch.c
+45
-1
未找到文件。
bsp/mini2440/.dm9000.c.swp
0 → 100644
浏览文件 @
0ddc739a
文件已添加
components/net/lwip-1.4.1/src/arch/sys_arch.c
浏览文件 @
0ddc739a
...
...
@@ -29,6 +29,11 @@
#include <string.h>
/*
* Initialize the network interface device
*
* @return the operation status, ERR_OK on OK, ERR_IF on error
*/
static
err_t
netif_device_init
(
struct
netif
*
netif
)
{
struct
eth_device
*
ethif
;
...
...
@@ -53,7 +58,9 @@ static err_t netif_device_init(struct netif *netif)
return
ERR_IF
;
}
/*
* Initialize the ethernetif layer and set network interface device up
*/
static
void
tcpip_init_done_callback
(
void
*
arg
)
{
rt_device_t
device
;
...
...
@@ -182,6 +189,11 @@ void lwip_sys_init(void)
lwip_system_init
();
}
/*
* Create a new semaphore
*
* @return the operation status, ERR_OK on OK; others on error
*/
err_t
sys_sem_new
(
sys_sem_t
*
sem
,
u8_t
count
)
{
static
unsigned
short
counter
=
0
;
...
...
@@ -204,17 +216,31 @@ err_t sys_sem_new(sys_sem_t *sem, u8_t count)
}
}
/*
* Deallocate a semaphore
*/
void
sys_sem_free
(
sys_sem_t
*
sem
)
{
RT_DEBUG_NOT_IN_INTERRUPT
;
rt_sem_delete
(
*
sem
);
}
/*
* Signal a semaphore
*/
void
sys_sem_signal
(
sys_sem_t
*
sem
)
{
rt_sem_release
(
*
sem
);
}
/*
* Block the thread while waiting for the semaphore to be signaled
*
* @return If the timeout argument is non-zero, it will return the number of milliseconds
* spent waiting for the semaphore to be signaled; If the semaphore isn't signaled
* within the specified time, it will return SYS_ARCH_TIMEOUT; If the thread doesn't
* wait for the semaphore, it will return zero
*/
u32_t
sys_arch_sem_wait
(
sys_sem_t
*
sem
,
u32_t
timeout
)
{
rt_err_t
ret
;
...
...
@@ -354,6 +380,11 @@ void sys_mutex_set_invalid(sys_mutex_t *mutex)
/* ====================== Mailbox ====================== */
/*
* Create an empty mailbox for maximum "size" elements
*
* @return the operation status, ERR_OK on OK; others on error
*/
err_t
sys_mbox_new
(
sys_mbox_t
*
mbox
,
int
size
)
{
static
unsigned
short
counter
=
0
;
...
...
@@ -376,6 +407,9 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size)
return
ERR_MEM
;
}
/*
* Deallocate a mailbox
*/
void
sys_mbox_free
(
sys_mbox_t
*
mbox
)
{
RT_DEBUG_NOT_IN_INTERRUPT
;
...
...
@@ -399,6 +433,11 @@ void sys_mbox_post(sys_mbox_t *mbox, void *msg)
return
;
}
/*
* Try to post the "msg" to the mailbox
*
* @return return ERR_OK if the "msg" is posted, ERR_MEM if the mailbox is full
*/
err_t
sys_mbox_trypost
(
sys_mbox_t
*
mbox
,
void
*
msg
)
{
if
(
rt_mb_send
(
*
mbox
,
(
rt_uint32_t
)
msg
)
==
RT_EOK
)
...
...
@@ -502,6 +541,11 @@ void sys_mbox_set_invalid(sys_mbox_t *mbox)
/* ====================== System ====================== */
/*
* Start a new thread named "name" with priority "prio" that will begin
* its execution in the function "thread()". The "arg" argument will be
* passed as an argument to the thread() function
*/
sys_thread_t
sys_thread_new
(
const
char
*
name
,
lwip_thread_fn
thread
,
void
*
arg
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录