Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yunqingabc
rt-thread
提交
a383385a
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,发现更多精彩内容 >>
提交
a383385a
编写于
12月 20, 2019
作者:
armink_ztl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sync from master v4.0.2 .
上级
840eec55
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
122 addition
and
1235 deletion
+122
-1235
components/dfs/src/dfs_file.c
components/dfs/src/dfs_file.c
+3
-5
components/drivers/spi/spi_flash_sfud.c
components/drivers/spi/spi_flash_sfud.c
+7
-5
components/drivers/src/pipe.c
components/drivers/src/pipe.c
+10
-2
components/drivers/src/ringblk_buf.c
components/drivers/src/ringblk_buf.c
+1
-1
components/libc/compilers/minilibc/signal.h
components/libc/compilers/minilibc/signal.h
+20
-0
components/utilities/Kconfig
components/utilities/Kconfig
+7
-3
components/utilities/ymodem/SConscript
components/utilities/ymodem/SConscript
+8
-1
components/utilities/ymodem/ry_sy.c
components/utilities/ymodem/ry_sy.c
+2
-1
components/utilities/ymodem/ymodem.c
components/utilities/ymodem/ymodem.c
+1
-1
include/libc/libc_signal.h
include/libc/libc_signal.h
+5
-10
include/rtthread.h
include/rtthread.h
+1
-0
src/thread.c
src/thread.c
+57
-0
tools/pymenuconfig.py
tools/pymenuconfig.py
+0
-1206
未找到文件。
components/dfs/src/dfs_file.c
浏览文件 @
a383385a
...
...
@@ -369,8 +369,7 @@ int dfs_file_stat(const char *path, struct stat *buf)
if
((
fs
=
dfs_filesystem_lookup
(
fullpath
))
==
NULL
)
{
LOG_E
(
"can't find mounted filesystem on this path:%s"
,
fullpath
);
LOG_E
(
"can't find mounted filesystem on this path:%s"
,
fullpath
);
rt_free
(
fullpath
);
return
-
ENOENT
;
...
...
@@ -399,8 +398,7 @@ int dfs_file_stat(const char *path, struct stat *buf)
if
(
fs
->
ops
->
stat
==
NULL
)
{
rt_free
(
fullpath
);
LOG_E
(
"the filesystem didn't implement this function"
);
LOG_E
(
"the filesystem didn't implement this function"
);
return
-
ENOSYS
;
}
...
...
@@ -565,7 +563,7 @@ void ls(const char *pathname)
}
else
{
rt_kprintf
(
"%-25lu
\n
"
,
stat
.
st_size
);
rt_kprintf
(
"%-25lu
\n
"
,
(
unsigned
long
)
stat
.
st_size
);
}
}
else
...
...
components/drivers/spi/spi_flash_sfud.c
浏览文件 @
a383385a
...
...
@@ -156,11 +156,11 @@ static sfud_err spi_write_read(const sfud_spi *spi, const uint8_t *write_buf, si
if
(
rtt_dev
->
rt_spi_device
->
bus
->
mode
&
RT_SPI_BUS_MODE_QSPI
)
{
qspi_dev
=
(
struct
rt_qspi_device
*
)
(
rtt_dev
->
rt_spi_device
);
if
(
write_size
&&
read_size
)
{
if
(
rt_qspi_send_then_recv
(
qspi_dev
,
write_buf
,
write_size
,
read_buf
,
read_size
)
=
=
0
)
{
if
(
rt_qspi_send_then_recv
(
qspi_dev
,
write_buf
,
write_size
,
read_buf
,
read_size
)
<
=
0
)
{
result
=
SFUD_ERR_TIMEOUT
;
}
}
else
if
(
write_size
)
{
if
(
rt_qspi_send
(
qspi_dev
,
write_buf
,
write_size
)
=
=
0
)
{
if
(
rt_qspi_send
(
qspi_dev
,
write_buf
,
write_size
)
<
=
0
)
{
result
=
SFUD_ERR_TIMEOUT
;
}
}
...
...
@@ -173,11 +173,11 @@ static sfud_err spi_write_read(const sfud_spi *spi, const uint8_t *write_buf, si
result
=
SFUD_ERR_TIMEOUT
;
}
}
else
if
(
write_size
)
{
if
(
rt_spi_send
(
rtt_dev
->
rt_spi_device
,
write_buf
,
write_size
)
=
=
0
)
{
if
(
rt_spi_send
(
rtt_dev
->
rt_spi_device
,
write_buf
,
write_size
)
<
=
0
)
{
result
=
SFUD_ERR_TIMEOUT
;
}
}
else
{
if
(
rt_spi_recv
(
rtt_dev
->
rt_spi_device
,
read_buf
,
read_size
)
=
=
0
)
{
if
(
rt_spi_recv
(
rtt_dev
->
rt_spi_device
,
read_buf
,
read_size
)
<
=
0
)
{
result
=
SFUD_ERR_TIMEOUT
;
}
}
...
...
@@ -322,7 +322,7 @@ sfud_err sfud_spi_port_init(sfud_flash *flash) {
}
#ifdef RT_USING_DEVICE_OPS
const
static
struct
rt_device_ops
flash_device_ops
=
const
static
struct
rt_device_ops
flash_device_ops
=
{
RT_NULL
,
RT_NULL
,
...
...
@@ -734,6 +734,7 @@ static void sf(uint8_t argc, char **argv) {
for
(
i
=
0
;
i
<
size
;
i
+=
write_size
)
{
result
=
sfud_write
(
sfud_dev
,
addr
+
i
,
write_size
,
write_data
);
if
(
result
!=
SFUD_SUCCESS
)
{
rt_kprintf
(
"Writing %s failed, already wr for %lu bytes, write %d each time
\n
"
,
sfud_dev
->
name
,
i
,
write_size
);
break
;
}
}
...
...
@@ -761,6 +762,7 @@ static void sf(uint8_t argc, char **argv) {
}
if
(
result
!=
SFUD_SUCCESS
)
{
rt_kprintf
(
"Read %s failed, already rd for %lu bytes, read %d each time
\n
"
,
sfud_dev
->
name
,
i
,
read_size
);
break
;
}
}
...
...
components/drivers/src/pipe.c
浏览文件 @
a383385a
...
...
@@ -19,6 +19,7 @@
static
int
pipe_fops_open
(
struct
dfs_fd
*
fd
)
{
int
rc
=
0
;
rt_device_t
device
;
rt_pipe_t
*
pipe
;
...
...
@@ -31,6 +32,11 @@ static int pipe_fops_open(struct dfs_fd *fd)
if
(
device
->
ref_count
==
0
)
{
pipe
->
fifo
=
rt_ringbuffer_create
(
pipe
->
bufsz
);
if
(
pipe
->
fifo
==
RT_NULL
)
{
rc
=
-
RT_ENOMEM
;
goto
__exit
;
}
}
switch
(
fd
->
flags
&
O_ACCMODE
)
...
...
@@ -48,9 +54,10 @@ static int pipe_fops_open(struct dfs_fd *fd)
}
device
->
ref_count
++
;
__exit:
rt_mutex_release
(
&
(
pipe
->
lock
));
return
0
;
return
rc
;
}
static
int
pipe_fops_close
(
struct
dfs_fd
*
fd
)
...
...
@@ -90,7 +97,8 @@ static int pipe_fops_close(struct dfs_fd *fd)
if
(
device
->
ref_count
==
1
)
{
rt_ringbuffer_destroy
(
pipe
->
fifo
);
if
(
pipe
->
fifo
!=
RT_NULL
)
rt_ringbuffer_destroy
(
pipe
->
fifo
);
pipe
->
fifo
=
RT_NULL
;
}
device
->
ref_count
--
;
...
...
components/drivers/src/ringblk_buf.c
浏览文件 @
a383385a
...
...
@@ -95,9 +95,9 @@ void rt_rbb_destroy(rt_rbb_t rbb)
{
RT_ASSERT
(
rbb
);
rt_free
(
rbb
);
rt_free
(
rbb
->
buf
);
rt_free
(
rbb
->
blk_set
);
rt_free
(
rbb
);
}
RTM_EXPORT
(
rt_rbb_destroy
);
...
...
components/libc/compilers/minilibc/signal.h
0 → 100644
浏览文件 @
a383385a
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017-09-12 Bernard The first version
*/
#ifndef SIGNAL_H__
#define SIGNAL_H__
#include <libc/libc_signal.h>
#define SIG_DFL ((_sig_func_ptr)0)
/* Default action */
#define SIG_IGN ((_sig_func_ptr)1)
/* Ignore action */
#define SIG_ERR ((_sig_func_ptr)-1)
/* Error return */
#endif
components/utilities/Kconfig
浏览文件 @
a383385a
...
...
@@ -2,12 +2,16 @@ menu "Utilities"
config RT_USING_RYM
bool "Enable Ymodem"
depends on RT_USING_DFS = y
default n
if RT_USING_RYM
config YMODEM_DISABLE_CRC_TABLE
bool "Disable CRC Table"
config YMODEM_USING_CRC_TABLE
bool "Enable CRC Table in Ymodem"
default n
config YMODEM_USING_FILE_TRANSFER
bool "Enable file transfer feature"
select RT_USING_DFS
default n
endif
...
...
components/utilities/ymodem/SConscript
浏览文件 @
a383385a
from
building
import
*
cwd
=
GetCurrentDir
()
src
=
Glob
(
'*.c'
)
src
=
Split
(
'''
ymodem.c
'''
)
CPPPATH
=
[
cwd
]
if
GetDepend
(
'RT_USING_DFS'
)
and
GetDepend
(
'YMODEM_USING_FILE_TRANSFER'
):
src
+=
[
'ry_sy.c'
]
group
=
DefineGroup
(
'Utilities'
,
src
,
depend
=
[
'RT_USING_RYM'
],
CPPPATH
=
CPPPATH
)
Return
(
'group'
)
components/utilities/ymodem/ry_sy.c
浏览文件 @
a383385a
...
...
@@ -11,8 +11,9 @@
#include <rtthread.h>
#include <ymodem.h>
#include <dfs_posix.h>
#include <stdio.h>
#include <stdlib.h>
#include <board.h>
#include <string.h>
struct
custom_ctx
...
...
components/utilities/ymodem/ymodem.c
浏览文件 @
a383385a
...
...
@@ -13,7 +13,7 @@
#include <rthw.h>
#include "ymodem.h"
#if
ndef YMODEM_DISABLE_CRC_TABLE
#if
def YMODEM_USING_CRC_TABLE
static
const
rt_uint16_t
ccitt_table
[
256
]
=
{
0x0000
,
0x1021
,
0x2042
,
0x3063
,
0x4084
,
0x50A5
,
0x60C6
,
0x70E7
,
...
...
include/libc/libc_signal.h
浏览文件 @
a383385a
...
...
@@ -63,13 +63,14 @@ typedef struct siginfo siginfo_t;
#define SI_MESGQ 0x05
/* Signal generated by arrival of a
message on an empty message queue. */
#ifdef RT_USING_NEWLIB
#include <sys/signal.h>
#if !defined(RT_USING_NEWLIB)
typedef
void
(
*
_sig_func_ptr
)(
int
);
typedef
unsigned
long
sigset_t
;
#endif
#if defined(__CC_ARM) || defined(__CLANG_ARM)
#include <signal.h>
typedef
unsigned
long
sigset_t
;
#if defined(__CC_ARM) || defined(__CLANG_ARM)
#define SIGHUP 1
/* #define SIGINT 2 */
...
...
@@ -105,8 +106,6 @@ typedef unsigned long sigset_t;
#define SIG_BLOCK 1
/* set of signals to block */
#define SIG_UNBLOCK 2
/* set of signals to, well, unblock */
typedef
void
(
*
_sig_func_ptr
)(
int
);
struct
sigaction
{
_sig_func_ptr
sa_handler
;
...
...
@@ -124,8 +123,6 @@ int sigprocmask (int how, const sigset_t *set, sigset_t *oset);
int
sigaction
(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
);
#elif defined(__IAR_SYSTEMS_ICC__)
#include <signal.h>
typedef
unsigned
long
sigset_t
;
#define SIGHUP 1
#define SIGINT 2
...
...
@@ -161,8 +158,6 @@ typedef unsigned long sigset_t;
#define SIG_BLOCK 1
/* set of signals to block */
#define SIG_UNBLOCK 2
/* set of signals to, well, unblock */
typedef
void
(
*
_sig_func_ptr
)(
int
);
struct
sigaction
{
_sig_func_ptr
sa_handler
;
...
...
include/rtthread.h
浏览文件 @
a383385a
...
...
@@ -137,6 +137,7 @@ rt_err_t rt_thread_delete(rt_thread_t thread);
rt_err_t
rt_thread_yield
(
void
);
rt_err_t
rt_thread_delay
(
rt_tick_t
tick
);
rt_err_t
rt_thread_delay_until
(
rt_tick_t
*
tick
,
rt_tick_t
inc_tick
);
rt_err_t
rt_thread_mdelay
(
rt_int32_t
ms
);
rt_err_t
rt_thread_control
(
rt_thread_t
thread
,
int
cmd
,
void
*
arg
);
rt_err_t
rt_thread_suspend
(
rt_thread_t
thread
);
...
...
src/thread.c
浏览文件 @
a383385a
...
...
@@ -534,6 +534,63 @@ rt_err_t rt_thread_delay(rt_tick_t tick)
}
RTM_EXPORT
(
rt_thread_delay
);
/**
* This function will let current thread delay until (*tick + inc_tick).
*
* @param tick the tick of last wakeup.
* @param inc_tick the increment tick
*
* @return RT_EOK
*/
rt_err_t
rt_thread_delay_until
(
rt_tick_t
*
tick
,
rt_tick_t
inc_tick
)
{
register
rt_base_t
level
;
struct
rt_thread
*
thread
;
RT_ASSERT
(
tick
!=
RT_NULL
);
/* set to current thread */
thread
=
rt_thread_self
();
RT_ASSERT
(
thread
!=
RT_NULL
);
RT_ASSERT
(
rt_object_get_type
((
rt_object_t
)
thread
)
==
RT_Object_Class_Thread
);
/* disable interrupt */
level
=
rt_hw_interrupt_disable
();
if
(
rt_tick_get
()
-
*
tick
<
inc_tick
)
{
*
tick
=
rt_tick_get
()
-
*
tick
+
inc_tick
;
/* suspend thread */
rt_thread_suspend
(
thread
);
/* reset the timeout of thread timer and start it */
rt_timer_control
(
&
(
thread
->
thread_timer
),
RT_TIMER_CTRL_SET_TIME
,
tick
);
rt_timer_start
(
&
(
thread
->
thread_timer
));
/* enable interrupt */
rt_hw_interrupt_enable
(
level
);
rt_schedule
();
/* clear error number of this thread to RT_EOK */
if
(
thread
->
error
==
-
RT_ETIMEOUT
)
{
thread
->
error
=
RT_EOK
;
}
}
else
{
rt_hw_interrupt_enable
(
level
);
}
/* get the wakeup tick */
*
tick
=
rt_tick_get
();
return
RT_EOK
;
}
RTM_EXPORT
(
rt_thread_delay_until
);
/**
* This function will let current thread delay for some milliseconds.
*
...
...
tools/pymenuconfig.py
已删除
100644 → 0
浏览文件 @
840eec55
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录