Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
e1a57f05
R
rt-thread
项目概览
BaiXuePrincess
/
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看板
未验证
提交
e1a57f05
编写于
6月 10, 2018
作者:
B
Bernard Xiong
提交者:
GitHub
6月 10, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1513 from armink/fix_sfud
[components][sfud] Update log info.
上级
17816563
24f633e0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
5 deletion
+8
-5
components/drivers/spi/spi_flash_sfud.c
components/drivers/spi/spi_flash_sfud.c
+8
-5
未找到文件。
components/drivers/spi/spi_flash_sfud.c
浏览文件 @
e1a57f05
...
...
@@ -183,7 +183,7 @@ void sfud_log_debug(const char *file, const long line, const char *format, ...)
/* args point to the first variable parameter */
va_start
(
args
,
format
);
rt_kprintf
(
"[SFUD](%s:%ld) "
,
file
,
line
);
rt_kprintf
(
"[SFUD]
(%s:%ld) "
,
file
,
line
);
/* must use vprintf to print */
vsnprintf
(
log_buf
,
sizeof
(
log_buf
),
format
,
args
);
rt_kprintf
(
"%s
\n
"
,
log_buf
);
...
...
@@ -201,7 +201,7 @@ void sfud_log_info(const char *format, ...) {
/* args point to the first variable parameter */
va_start
(
args
,
format
);
rt_kprintf
(
"[SFUD]"
);
rt_kprintf
(
"[SFUD]
"
);
/* must use vprintf to print */
vsnprintf
(
log_buf
,
sizeof
(
log_buf
),
format
,
args
);
rt_kprintf
(
"%s
\n
"
,
log_buf
);
...
...
@@ -216,6 +216,9 @@ sfud_err sfud_spi_port_init(sfud_flash *flash) {
flash
->
spi
.
lock
=
spi_lock
;
flash
->
spi
.
unlock
=
spi_unlock
;
flash
->
spi
.
user_data
=
flash
;
if
(
RT_TICK_PER_SECOND
<
1000
)
{
rt_kprintf
(
"[SFUD] Warning: The OS tick(%d) is less than 1000. So the flash write will take more time.
\n
"
,
RT_TICK_PER_SECOND
);
}
/* 100 microsecond delay */
flash
->
retry
.
delay
=
retry_delay_100us
;
/* 60 seconds timeout */
...
...
@@ -355,7 +358,7 @@ rt_err_t rt_sfud_flash_delete(rt_spi_flash_device_t spi_flash_dev) {
static
void
sf
(
uint8_t
argc
,
char
**
argv
)
{
#define CMD_
SETECT_INDEX
0
#define CMD_
PROBE_INDEX
0
#define CMD_READ_INDEX 1
#define CMD_WRITE_INDEX 2
#define CMD_ERASE_INDEX 3
...
...
@@ -368,7 +371,7 @@ static void sf(uint8_t argc, char **argv) {
size_t
i
=
0
;
const
char
*
sf_help_info
[]
=
{
[
CMD_
SETECT_INDEX
]
=
"sf probe [spi_device] - probe and init SPI flash by given 'spi_device'"
,
[
CMD_
PROBE_INDEX
]
=
"sf probe [spi_device] - probe and init SPI flash by given 'spi_device'"
,
[
CMD_READ_INDEX
]
=
"sf read addr size - read 'size' bytes starting at 'addr'"
,
[
CMD_WRITE_INDEX
]
=
"sf write addr data1 ... dataN - write some bytes 'data' to flash starting at 'addr'"
,
[
CMD_ERASE_INDEX
]
=
"sf erase addr size - erase 'size' bytes starting at 'addr'"
,
...
...
@@ -388,7 +391,7 @@ static void sf(uint8_t argc, char **argv) {
if
(
!
strcmp
(
operator
,
"probe"
))
{
if
(
argc
<
3
)
{
rt_kprintf
(
"Usage: %s.
\n
"
,
sf_help_info
[
CMD_
SETECT
_INDEX
]);
rt_kprintf
(
"Usage: %s.
\n
"
,
sf_help_info
[
CMD_
PROBE
_INDEX
]);
}
else
{
char
*
spi_dev_name
=
argv
[
2
];
rtt_dev_bak
=
rtt_dev
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录