Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
码匠许师傅
rt-thread
提交
e019a57f
R
rt-thread
项目概览
码匠许师傅
/
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,发现更多精彩内容 >>
提交
e019a57f
编写于
6月 10, 2021
作者:
mysterywolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kernel] 补充endif后缀注释(2)
上级
24b4b6cb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
49 deletion
+47
-49
src/ipc.c
src/ipc.c
+15
-15
src/irq.c
src/irq.c
+2
-4
src/kservice.c
src/kservice.c
+30
-30
未找到文件。
src/ipc.c
浏览文件 @
e019a57f
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
extern
void
(
*
rt_object_trytake_hook
)(
struct
rt_object
*
object
);
extern
void
(
*
rt_object_trytake_hook
)(
struct
rt_object
*
object
);
extern
void
(
*
rt_object_take_hook
)(
struct
rt_object
*
object
);
extern
void
(
*
rt_object_take_hook
)(
struct
rt_object
*
object
);
extern
void
(
*
rt_object_put_hook
)(
struct
rt_object
*
object
);
extern
void
(
*
rt_object_put_hook
)(
struct
rt_object
*
object
);
#endif
#endif
/* RT_USING_HOOK */
/**
/**
* @addtogroup IPC
* @addtogroup IPC
...
@@ -93,7 +93,7 @@ rt_inline rt_err_t rt_ipc_list_suspend(rt_list_t *list,
...
@@ -93,7 +93,7 @@ rt_inline rt_err_t rt_ipc_list_suspend(rt_list_t *list,
{
{
case
RT_IPC_FLAG_FIFO
:
case
RT_IPC_FLAG_FIFO
:
rt_list_insert_before
(
list
,
&
(
thread
->
tlist
));
rt_list_insert_before
(
list
,
&
(
thread
->
tlist
));
break
;
break
;
/* RT_IPC_FLAG_FIFO */
case
RT_IPC_FLAG_PRIO
:
case
RT_IPC_FLAG_PRIO
:
{
{
...
@@ -121,7 +121,7 @@ rt_inline rt_err_t rt_ipc_list_suspend(rt_list_t *list,
...
@@ -121,7 +121,7 @@ rt_inline rt_err_t rt_ipc_list_suspend(rt_list_t *list,
if
(
n
==
list
)
if
(
n
==
list
)
rt_list_insert_before
(
list
,
&
(
thread
->
tlist
));
rt_list_insert_before
(
list
,
&
(
thread
->
tlist
));
}
}
break
;
break
;
/* RT_IPC_FLAG_PRIO */
default:
default:
RT_ASSERT
(
0
);
RT_ASSERT
(
0
);
...
@@ -319,7 +319,7 @@ rt_err_t rt_sem_delete(rt_sem_t sem)
...
@@ -319,7 +319,7 @@ rt_err_t rt_sem_delete(rt_sem_t sem)
return
RT_EOK
;
return
RT_EOK
;
}
}
RTM_EXPORT
(
rt_sem_delete
);
RTM_EXPORT
(
rt_sem_delete
);
#endif
#endif
/* RT_USING_HEAP */
/**
/**
* This function will take a semaphore, if the semaphore is unavailable, the
* This function will take a semaphore, if the semaphore is unavailable, the
...
@@ -533,7 +533,7 @@ rt_err_t rt_sem_control(rt_sem_t sem, int cmd, void *arg)
...
@@ -533,7 +533,7 @@ rt_err_t rt_sem_control(rt_sem_t sem, int cmd, void *arg)
return
-
RT_ERROR
;
return
-
RT_ERROR
;
}
}
RTM_EXPORT
(
rt_sem_control
);
RTM_EXPORT
(
rt_sem_control
);
#endif
/*
end of
RT_USING_SEMAPHORE */
#endif
/* RT_USING_SEMAPHORE */
#ifdef RT_USING_MUTEX
#ifdef RT_USING_MUTEX
/**
/**
...
@@ -659,7 +659,7 @@ rt_err_t rt_mutex_delete(rt_mutex_t mutex)
...
@@ -659,7 +659,7 @@ rt_err_t rt_mutex_delete(rt_mutex_t mutex)
return
RT_EOK
;
return
RT_EOK
;
}
}
RTM_EXPORT
(
rt_mutex_delete
);
RTM_EXPORT
(
rt_mutex_delete
);
#endif
#endif
/* RT_USING_HEAP */
/**
/**
* This function will take a mutex, if the mutex is unavailable, the
* This function will take a mutex, if the mutex is unavailable, the
...
@@ -714,7 +714,7 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
...
@@ -714,7 +714,7 @@ rt_err_t rt_mutex_take(rt_mutex_t mutex, rt_int32_t time)
{
{
#ifdef RT_USING_SIGNALS
#ifdef RT_USING_SIGNALS
__again:
__again:
#endif
/*
end of
RT_USING_SIGNALS */
#endif
/* RT_USING_SIGNALS */
/* The value of mutex is 1 in initial status. Therefore, if the
/* The value of mutex is 1 in initial status. Therefore, if the
* value is great than 0, it indicates the mutex is avaible.
* value is great than 0, it indicates the mutex is avaible.
*/
*/
...
@@ -794,7 +794,7 @@ __again:
...
@@ -794,7 +794,7 @@ __again:
#ifdef RT_USING_SIGNALS
#ifdef RT_USING_SIGNALS
/* interrupt by signal, try it again */
/* interrupt by signal, try it again */
if
(
thread
->
error
==
-
RT_EINTR
)
goto
__again
;
if
(
thread
->
error
==
-
RT_EINTR
)
goto
__again
;
#endif
/*
end of
RT_USING_SIGNALS */
#endif
/* RT_USING_SIGNALS */
/* return error */
/* return error */
return
thread
->
error
;
return
thread
->
error
;
...
@@ -968,7 +968,7 @@ rt_err_t rt_mutex_control(rt_mutex_t mutex, int cmd, void *arg)
...
@@ -968,7 +968,7 @@ rt_err_t rt_mutex_control(rt_mutex_t mutex, int cmd, void *arg)
return
-
RT_ERROR
;
return
-
RT_ERROR
;
}
}
RTM_EXPORT
(
rt_mutex_control
);
RTM_EXPORT
(
rt_mutex_control
);
#endif
/*
end of
RT_USING_MUTEX */
#endif
/* RT_USING_MUTEX */
#ifdef RT_USING_EVENT
#ifdef RT_USING_EVENT
/**
/**
...
@@ -1084,7 +1084,7 @@ rt_err_t rt_event_delete(rt_event_t event)
...
@@ -1084,7 +1084,7 @@ rt_err_t rt_event_delete(rt_event_t event)
return
RT_EOK
;
return
RT_EOK
;
}
}
RTM_EXPORT
(
rt_event_delete
);
RTM_EXPORT
(
rt_event_delete
);
#endif
#endif
/* RT_USING_HEAP */
/**
/**
* This function will send an event to the event object, if there are threads
* This function will send an event to the event object, if there are threads
...
@@ -1361,7 +1361,7 @@ rt_err_t rt_event_control(rt_event_t event, int cmd, void *arg)
...
@@ -1361,7 +1361,7 @@ rt_err_t rt_event_control(rt_event_t event, int cmd, void *arg)
return
-
RT_ERROR
;
return
-
RT_ERROR
;
}
}
RTM_EXPORT
(
rt_event_control
);
RTM_EXPORT
(
rt_event_control
);
#endif
/*
end of
RT_USING_EVENT */
#endif
/* RT_USING_EVENT */
#ifdef RT_USING_MAILBOX
#ifdef RT_USING_MAILBOX
/**
/**
...
@@ -1512,7 +1512,7 @@ rt_err_t rt_mb_delete(rt_mailbox_t mb)
...
@@ -1512,7 +1512,7 @@ rt_err_t rt_mb_delete(rt_mailbox_t mb)
return
RT_EOK
;
return
RT_EOK
;
}
}
RTM_EXPORT
(
rt_mb_delete
);
RTM_EXPORT
(
rt_mb_delete
);
#endif
#endif
/* RT_USING_HEAP */
/**
/**
* This function will send a mail to mailbox object. If the mailbox is full,
* This function will send a mail to mailbox object. If the mailbox is full,
...
@@ -1919,7 +1919,7 @@ rt_err_t rt_mb_control(rt_mailbox_t mb, int cmd, void *arg)
...
@@ -1919,7 +1919,7 @@ rt_err_t rt_mb_control(rt_mailbox_t mb, int cmd, void *arg)
return
-
RT_ERROR
;
return
-
RT_ERROR
;
}
}
RTM_EXPORT
(
rt_mb_control
);
RTM_EXPORT
(
rt_mb_control
);
#endif
/*
end of
RT_USING_MAILBOX */
#endif
/* RT_USING_MAILBOX */
#ifdef RT_USING_MESSAGEQUEUE
#ifdef RT_USING_MESSAGEQUEUE
struct
rt_mq_message
struct
rt_mq_message
...
@@ -2121,7 +2121,7 @@ rt_err_t rt_mq_delete(rt_mq_t mq)
...
@@ -2121,7 +2121,7 @@ rt_err_t rt_mq_delete(rt_mq_t mq)
return
RT_EOK
;
return
RT_EOK
;
}
}
RTM_EXPORT
(
rt_mq_delete
);
RTM_EXPORT
(
rt_mq_delete
);
#endif
#endif
/* RT_USING_HEAP */
/**
/**
* This function will send a message to message queue object. If the message queue is full,
* This function will send a message to message queue object. If the message queue is full,
...
@@ -2625,6 +2625,6 @@ rt_err_t rt_mq_control(rt_mq_t mq, int cmd, void *arg)
...
@@ -2625,6 +2625,6 @@ rt_err_t rt_mq_control(rt_mq_t mq, int cmd, void *arg)
return
-
RT_ERROR
;
return
-
RT_ERROR
;
}
}
RTM_EXPORT
(
rt_mq_control
);
RTM_EXPORT
(
rt_mq_control
);
#endif
/*
end of
RT_USING_MESSAGEQUEUE */
#endif
/* RT_USING_MESSAGEQUEUE */
/**@}*/
/**@}*/
src/irq.c
浏览文件 @
e019a57f
...
@@ -39,9 +39,7 @@ void rt_interrupt_leave_sethook(void (*hook)(void))
...
@@ -39,9 +39,7 @@ void rt_interrupt_leave_sethook(void (*hook)(void))
{
{
rt_interrupt_leave_hook
=
hook
;
rt_interrupt_leave_hook
=
hook
;
}
}
#endif
#endif
/* RT_USING_HOOK */
/* #define IRQ_DEBUG */
/**
/**
* @addtogroup Kernel
* @addtogroup Kernel
...
@@ -53,7 +51,7 @@ void rt_interrupt_leave_sethook(void (*hook)(void))
...
@@ -53,7 +51,7 @@ void rt_interrupt_leave_sethook(void (*hook)(void))
#define rt_interrupt_nest rt_cpu_self()->irq_nest
#define rt_interrupt_nest rt_cpu_self()->irq_nest
#else
#else
volatile
rt_uint8_t
rt_interrupt_nest
=
0
;
volatile
rt_uint8_t
rt_interrupt_nest
=
0
;
#endif
#endif
/* RT_USING_SMP */
/**
/**
* This function will be invoked by BSP, when enter interrupt service routine
* This function will be invoked by BSP, when enter interrupt service routine
...
...
src/kservice.c
浏览文件 @
e019a57f
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#ifdef RT_USING_MODULE
#ifdef RT_USING_MODULE
#include <dlmodule.h>
#include <dlmodule.h>
#endif
#endif
/* RT_USING_MODULE */
/* use precision */
/* use precision */
#define RT_PRINTF_PRECISION
#define RT_PRINTF_PRECISION
...
@@ -194,7 +194,7 @@ RT_WEAK void *rt_memset(void *s, int c, rt_ubase_t count)
...
@@ -194,7 +194,7 @@ RT_WEAK void *rt_memset(void *s, int c, rt_ubase_t count)
#undef LBLOCKSIZE
#undef LBLOCKSIZE
#undef UNALIGNED
#undef UNALIGNED
#undef TOO_SMALL
#undef TOO_SMALL
#endif
#endif
/* RT_KSERVICE_USING_TINY_SIZE */
}
}
RTM_EXPORT
(
rt_memset
);
RTM_EXPORT
(
rt_memset
);
...
@@ -277,7 +277,7 @@ RT_WEAK void *rt_memcpy(void *dst, const void *src, rt_ubase_t count)
...
@@ -277,7 +277,7 @@ RT_WEAK void *rt_memcpy(void *dst, const void *src, rt_ubase_t count)
#undef BIGBLOCKSIZE
#undef BIGBLOCKSIZE
#undef LITTLEBLOCKSIZE
#undef LITTLEBLOCKSIZE
#undef TOO_SMALL
#undef TOO_SMALL
#endif
#endif
/* RT_KSERVICE_USING_TINY_SIZE */
}
}
RTM_EXPORT
(
rt_memcpy
);
RTM_EXPORT
(
rt_memcpy
);
...
@@ -509,7 +509,7 @@ rt_size_t rt_strlen(const char *s)
...
@@ -509,7 +509,7 @@ rt_size_t rt_strlen(const char *s)
}
}
RTM_EXPORT
(
rt_strlen
);
RTM_EXPORT
(
rt_strlen
);
#endif
/*
RT_KSERVICE_USING_STDLIB
*/
#endif
/*
RT_KSERVICE_USING_STDLIB
*/
#ifdef RT_USING_HEAP
#ifdef RT_USING_HEAP
/**
/**
...
@@ -535,7 +535,7 @@ RTM_EXPORT(rt_strdup);
...
@@ -535,7 +535,7 @@ RTM_EXPORT(rt_strdup);
#if defined(__CC_ARM) || defined(__CLANG_ARM)
#if defined(__CC_ARM) || defined(__CLANG_ARM)
char
*
strdup
(
const
char
*
s
)
__attribute__
((
alias
(
"rt_strdup"
)));
char
*
strdup
(
const
char
*
s
)
__attribute__
((
alias
(
"rt_strdup"
)));
#endif
#endif
#endif
#endif
/* RT_USING_HEAP */
/**
/**
* This function will show the version of rt-thread rtos
* This function will show the version of rt-thread rtos
...
@@ -591,7 +591,7 @@ rt_inline int divide(long *n, int base)
...
@@ -591,7 +591,7 @@ rt_inline int divide(long *n, int base)
return
res
;
return
res
;
}
}
#endif
#endif
/* RT_PRINTF_LONGLONG */
rt_inline
int
skip_atoi
(
const
char
**
s
)
rt_inline
int
skip_atoi
(
const
char
**
s
)
{
{
...
@@ -617,7 +617,7 @@ static char *print_number(char *buf,
...
@@ -617,7 +617,7 @@ static char *print_number(char *buf,
long
long
num
,
long
long
num
,
#else
#else
long
num
,
long
num
,
#endif
#endif
/* RT_PRINTF_LONGLONG */
int
base
,
int
base
,
int
s
,
int
s
,
int
precision
,
int
precision
,
...
@@ -629,18 +629,18 @@ static char *print_number(char *buf,
...
@@ -629,18 +629,18 @@ static char *print_number(char *buf,
long
long
num
,
long
long
num
,
#else
#else
long
num
,
long
num
,
#endif
#endif
/* RT_PRINTF_LONGLONG */
int
base
,
int
base
,
int
s
,
int
s
,
int
type
)
int
type
)
#endif
#endif
/* RT_PRINTF_PRECISION */
{
{
char
c
,
sign
;
char
c
,
sign
;
#ifdef RT_PRINTF_LONGLONG
#ifdef RT_PRINTF_LONGLONG
char
tmp
[
32
];
char
tmp
[
32
];
#else
#else
char
tmp
[
16
];
char
tmp
[
16
];
#endif
#endif
/* RT_PRINTF_LONGLONG */
int
precision_bak
=
precision
;
int
precision_bak
=
precision
;
const
char
*
digits
;
const
char
*
digits
;
static
const
char
small_digits
[]
=
"0123456789abcdef"
;
static
const
char
small_digits
[]
=
"0123456789abcdef"
;
...
@@ -679,7 +679,7 @@ static char *print_number(char *buf,
...
@@ -679,7 +679,7 @@ static char *print_number(char *buf,
else
if
(
base
==
8
)
else
if
(
base
==
8
)
size
--
;
size
--
;
}
}
#endif
#endif
/* RT_PRINTF_SPECIAL */
i
=
0
;
i
=
0
;
if
(
num
==
0
)
if
(
num
==
0
)
...
@@ -696,7 +696,7 @@ static char *print_number(char *buf,
...
@@ -696,7 +696,7 @@ static char *print_number(char *buf,
size
-=
precision
;
size
-=
precision
;
#else
#else
size
-=
i
;
size
-=
i
;
#endif
#endif
/* RT_PRINTF_PRECISION */
if
(
!
(
type
&
(
ZEROPAD
|
LEFT
)))
if
(
!
(
type
&
(
ZEROPAD
|
LEFT
)))
{
{
...
@@ -742,7 +742,7 @@ static char *print_number(char *buf,
...
@@ -742,7 +742,7 @@ static char *print_number(char *buf,
++
buf
;
++
buf
;
}
}
}
}
#endif
#endif
/* RT_PRINTF_SPECIAL */
/* no align to the left */
/* no align to the left */
if
(
!
(
type
&
LEFT
))
if
(
!
(
type
&
LEFT
))
...
@@ -762,7 +762,7 @@ static char *print_number(char *buf,
...
@@ -762,7 +762,7 @@ static char *print_number(char *buf,
*
buf
=
'0'
;
*
buf
=
'0'
;
++
buf
;
++
buf
;
}
}
#endif
#endif
/* RT_PRINTF_PRECISION */
/* put number in the temporary buffer */
/* put number in the temporary buffer */
while
(
i
--
>
0
&&
(
precision_bak
!=
0
))
while
(
i
--
>
0
&&
(
precision_bak
!=
0
))
...
@@ -791,7 +791,7 @@ rt_int32_t rt_vsnprintf(char *buf,
...
@@ -791,7 +791,7 @@ rt_int32_t rt_vsnprintf(char *buf,
unsigned
long
long
num
;
unsigned
long
long
num
;
#else
#else
rt_uint32_t
num
;
rt_uint32_t
num
;
#endif
#endif
/* RT_PRINTF_LONGLONG */
int
i
,
len
;
int
i
,
len
;
char
*
str
,
*
end
,
c
;
char
*
str
,
*
end
,
c
;
const
char
*
s
;
const
char
*
s
;
...
@@ -803,7 +803,7 @@ rt_int32_t rt_vsnprintf(char *buf,
...
@@ -803,7 +803,7 @@ rt_int32_t rt_vsnprintf(char *buf,
#ifdef RT_PRINTF_PRECISION
#ifdef RT_PRINTF_PRECISION
int
precision
;
/* min. # of digits for integers and max for a string */
int
precision
;
/* min. # of digits for integers and max for a string */
#endif
#endif
/* RT_PRINTF_PRECISION */
str
=
buf
;
str
=
buf
;
end
=
buf
+
size
;
end
=
buf
+
size
;
...
@@ -870,14 +870,14 @@ rt_int32_t rt_vsnprintf(char *buf,
...
@@ -870,14 +870,14 @@ rt_int32_t rt_vsnprintf(char *buf,
}
}
if
(
precision
<
0
)
precision
=
0
;
if
(
precision
<
0
)
precision
=
0
;
}
}
#endif
#endif
/* RT_PRINTF_PRECISION */
/* get the conversion qualifier */
/* get the conversion qualifier */
qualifier
=
0
;
qualifier
=
0
;
#ifdef RT_PRINTF_LONGLONG
#ifdef RT_PRINTF_LONGLONG
if
(
*
fmt
==
'h'
||
*
fmt
==
'l'
||
*
fmt
==
'L'
)
if
(
*
fmt
==
'h'
||
*
fmt
==
'l'
||
*
fmt
==
'L'
)
#else
#else
if
(
*
fmt
==
'h'
||
*
fmt
==
'l'
)
if
(
*
fmt
==
'h'
||
*
fmt
==
'l'
)
#endif
#endif
/* RT_PRINTF_LONGLONG */
{
{
qualifier
=
*
fmt
;
qualifier
=
*
fmt
;
++
fmt
;
++
fmt
;
...
@@ -887,7 +887,7 @@ rt_int32_t rt_vsnprintf(char *buf,
...
@@ -887,7 +887,7 @@ rt_int32_t rt_vsnprintf(char *buf,
qualifier
=
'L'
;
qualifier
=
'L'
;
++
fmt
;
++
fmt
;
}
}
#endif
#endif
/* RT_PRINTF_LONGLONG */
}
}
/* the default base */
/* the default base */
...
@@ -925,7 +925,7 @@ rt_int32_t rt_vsnprintf(char *buf,
...
@@ -925,7 +925,7 @@ rt_int32_t rt_vsnprintf(char *buf,
for
(
len
=
0
;
(
len
!=
field_width
)
&&
(
s
[
len
]
!=
'\0'
);
len
++
);
for
(
len
=
0
;
(
len
!=
field_width
)
&&
(
s
[
len
]
!=
'\0'
);
len
++
);
#ifdef RT_PRINTF_PRECISION
#ifdef RT_PRINTF_PRECISION
if
(
precision
>
0
&&
len
>
precision
)
len
=
precision
;
if
(
precision
>
0
&&
len
>
precision
)
len
=
precision
;
#endif
#endif
/* RT_PRINTF_PRECISION */
if
(
!
(
flags
&
LEFT
))
if
(
!
(
flags
&
LEFT
))
{
{
...
@@ -964,7 +964,7 @@ rt_int32_t rt_vsnprintf(char *buf,
...
@@ -964,7 +964,7 @@ rt_int32_t rt_vsnprintf(char *buf,
str
=
print_number
(
str
,
end
,
str
=
print_number
(
str
,
end
,
(
long
)
va_arg
(
args
,
void
*
),
(
long
)
va_arg
(
args
,
void
*
),
16
,
field_width
,
flags
);
16
,
field_width
,
flags
);
#endif
#endif
/* RT_PRINTF_PRECISION */
continue
;
continue
;
case
'%'
:
case
'%'
:
...
@@ -1010,7 +1010,7 @@ rt_int32_t rt_vsnprintf(char *buf,
...
@@ -1010,7 +1010,7 @@ rt_int32_t rt_vsnprintf(char *buf,
else
if
(
qualifier
==
'l'
)
else
if
(
qualifier
==
'l'
)
#else
#else
if
(
qualifier
==
'l'
)
if
(
qualifier
==
'l'
)
#endif
#endif
/* RT_PRINTF_LONGLONG */
{
{
num
=
va_arg
(
args
,
rt_uint32_t
);
num
=
va_arg
(
args
,
rt_uint32_t
);
if
(
flags
&
SIGN
)
num
=
(
rt_int32_t
)
num
;
if
(
flags
&
SIGN
)
num
=
(
rt_int32_t
)
num
;
...
@@ -1029,7 +1029,7 @@ rt_int32_t rt_vsnprintf(char *buf,
...
@@ -1029,7 +1029,7 @@ rt_int32_t rt_vsnprintf(char *buf,
str
=
print_number
(
str
,
end
,
num
,
base
,
field_width
,
precision
,
flags
);
str
=
print_number
(
str
,
end
,
num
,
base
,
field_width
,
precision
,
flags
);
#else
#else
str
=
print_number
(
str
,
end
,
num
,
base
,
field_width
,
flags
);
str
=
print_number
(
str
,
end
,
num
,
base
,
field_width
,
flags
);
#endif
#endif
/* RT_PRINTF_PRECISION */
}
}
if
(
size
>
0
)
if
(
size
>
0
)
...
@@ -1152,7 +1152,7 @@ rt_device_t rt_console_set_device(const char *name)
...
@@ -1152,7 +1152,7 @@ rt_device_t rt_console_set_device(const char *name)
return
old_device
;
return
old_device
;
}
}
RTM_EXPORT
(
rt_console_set_device
);
RTM_EXPORT
(
rt_console_set_device
);
#endif
#endif
/* RT_USING_DEVICE */
RT_WEAK
void
rt_hw_console_output
(
const
char
*
str
)
RT_WEAK
void
rt_hw_console_output
(
const
char
*
str
)
{
{
...
@@ -1184,7 +1184,7 @@ void rt_kputs(const char *str)
...
@@ -1184,7 +1184,7 @@ void rt_kputs(const char *str)
}
}
#else
#else
rt_hw_console_output
(
str
);
rt_hw_console_output
(
str
);
#endif
#endif
/* RT_USING_DEVICE */
}
}
/**
/**
...
@@ -1222,11 +1222,11 @@ RT_WEAK void rt_kprintf(const char *fmt, ...)
...
@@ -1222,11 +1222,11 @@ RT_WEAK void rt_kprintf(const char *fmt, ...)
}
}
#else
#else
rt_hw_console_output
(
rt_log_buf
);
rt_hw_console_output
(
rt_log_buf
);
#endif
#endif
/* RT_USING_DEVICE */
va_end
(
args
);
va_end
(
args
);
}
}
RTM_EXPORT
(
rt_kprintf
);
RTM_EXPORT
(
rt_kprintf
);
#endif
#endif
/* RT_USING_CONSOLE */
#ifdef RT_USING_HEAP
#ifdef RT_USING_HEAP
/**
/**
...
@@ -1292,7 +1292,7 @@ void rt_free_align(void *ptr)
...
@@ -1292,7 +1292,7 @@ void rt_free_align(void *ptr)
rt_free
(
real_ptr
);
rt_free
(
real_ptr
);
}
}
RTM_EXPORT
(
rt_free_align
);
RTM_EXPORT
(
rt_free_align
);
#endif
#endif
/* RT_USING_HEAP */
#ifndef RT_USING_CPU_FFS
#ifndef RT_USING_CPU_FFS
const
rt_uint8_t
__lowest_bit_bitmap
[]
=
const
rt_uint8_t
__lowest_bit_bitmap
[]
=
...
@@ -1340,7 +1340,7 @@ int __rt_ffs(int value)
...
@@ -1340,7 +1340,7 @@ int __rt_ffs(int value)
return
__lowest_bit_bitmap
[(
value
&
0xff000000
)
>>
24
]
+
25
;
return
__lowest_bit_bitmap
[(
value
&
0xff000000
)
>>
24
]
+
25
;
}
}
#endif
#endif
/* RT_USING_CPU_FFS */
#ifdef RT_DEBUG
#ifdef RT_DEBUG
/* RT_ASSERT(EX)'s hook */
/* RT_ASSERT(EX)'s hook */
...
@@ -1377,7 +1377,7 @@ void rt_assert_handler(const char *ex_string, const char *func, rt_size_t line)
...
@@ -1377,7 +1377,7 @@ void rt_assert_handler(const char *ex_string, const char *func, rt_size_t line)
dlmodule_exit
(
-
1
);
dlmodule_exit
(
-
1
);
}
}
else
else
#endif
#endif
/*RT_USING_MODULE*/
{
{
rt_kprintf
(
"(%s) assertion failed at function:%s, line number:%d
\n
"
,
ex_string
,
func
,
line
);
rt_kprintf
(
"(%s) assertion failed at function:%s, line number:%d
\n
"
,
ex_string
,
func
,
line
);
while
(
dummy
==
0
);
while
(
dummy
==
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录