Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
卖小麦←_←
rt-thread
提交
923fb0c1
R
rt-thread
项目概览
卖小麦←_←
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
923fb0c1
编写于
12月 21, 2021
作者:
mysterywolf
提交者:
Bernard Xiong
12月 27, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[rtdef] re-implement RT_UNUSED
上级
d16ca48f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
23 addition
and
19 deletion
+23
-19
bsp/at32/Libraries/rt_drivers/drv_gpio.c
bsp/at32/Libraries/rt_drivers/drv_gpio.c
+6
-2
bsp/lpc2148/drivers/serial.c
bsp/lpc2148/drivers/serial.c
+3
-1
bsp/lpc2478/drivers/serial.c
bsp/lpc2478/drivers/serial.c
+3
-1
bsp/mini4020/drivers/board.c
bsp/mini4020/drivers/board.c
+3
-1
bsp/mini4020/drivers/sdcard.c
bsp/mini4020/drivers/sdcard.c
+3
-1
include/rtdef.h
include/rtdef.h
+5
-13
未找到文件。
bsp/at32/Libraries/rt_drivers/drv_gpio.c
浏览文件 @
923fb0c1
...
@@ -205,11 +205,13 @@ rt_inline const struct pin_irq_map *get_pin_irq_map(uint32_t pinbit)
...
@@ -205,11 +205,13 @@ rt_inline const struct pin_irq_map *get_pin_irq_map(uint32_t pinbit)
static
rt_err_t
at32_pin_attach_irq
(
struct
rt_device
*
device
,
rt_int32_t
pin
,
static
rt_err_t
at32_pin_attach_irq
(
struct
rt_device
*
device
,
rt_int32_t
pin
,
rt_uint32_t
mode
,
void
(
*
hdr
)(
void
*
args
),
void
*
args
)
rt_uint32_t
mode
,
void
(
*
hdr
)(
void
*
args
),
void
*
args
)
{
{
RT_UNUSED
GPIO_Type
*
gpio_port
;
GPIO_Type
*
gpio_port
;
uint16_t
gpio_pin
;
uint16_t
gpio_pin
;
rt_base_t
level
;
rt_base_t
level
;
rt_int32_t
irqindex
=
-
1
;
rt_int32_t
irqindex
=
-
1
;
RT_UNUSED
(
gpio_port
);
if
(
PIN_PORT
(
pin
)
<
PIN_ATPORT_MAX
)
if
(
PIN_PORT
(
pin
)
<
PIN_ATPORT_MAX
)
{
{
gpio_port
=
PIN_ATPORT
(
pin
);
gpio_port
=
PIN_ATPORT
(
pin
);
...
@@ -251,11 +253,13 @@ static rt_err_t at32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
...
@@ -251,11 +253,13 @@ static rt_err_t at32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
static
rt_err_t
at32_pin_dettach_irq
(
struct
rt_device
*
device
,
rt_int32_t
pin
)
static
rt_err_t
at32_pin_dettach_irq
(
struct
rt_device
*
device
,
rt_int32_t
pin
)
{
{
RT_UNUSED
GPIO_Type
*
gpio_port
;
GPIO_Type
*
gpio_port
;
uint16_t
gpio_pin
;
uint16_t
gpio_pin
;
rt_base_t
level
;
rt_base_t
level
;
rt_int32_t
irqindex
=
-
1
;
rt_int32_t
irqindex
=
-
1
;
RT_UNUSED
(
gpio_port
);
if
(
PIN_PORT
(
pin
)
<
PIN_ATPORT_MAX
)
if
(
PIN_PORT
(
pin
)
<
PIN_ATPORT_MAX
)
{
{
gpio_port
=
PIN_ATPORT
(
pin
);
gpio_port
=
PIN_ATPORT
(
pin
);
...
...
bsp/lpc2148/drivers/serial.c
浏览文件 @
923fb0c1
...
@@ -62,10 +62,12 @@ void rt_hw_serial_init(void);
...
@@ -62,10 +62,12 @@ void rt_hw_serial_init(void);
void
rt_hw_uart_isr
(
struct
rt_lpcserial
*
lpc_serial
)
void
rt_hw_uart_isr
(
struct
rt_lpcserial
*
lpc_serial
)
{
{
RT_UNUSED
rt_uint32_t
iir
;
rt_uint32_t
iir
;
RT_ASSERT
(
lpc_serial
!=
RT_NULL
)
RT_ASSERT
(
lpc_serial
!=
RT_NULL
)
RT_UNUSED
(
iir
);
if
(
UART_LSR
(
lpc_serial
->
hw_base
)
&
0x01
)
if
(
UART_LSR
(
lpc_serial
->
hw_base
)
&
0x01
)
{
{
rt_base_t
level
;
rt_base_t
level
;
...
...
bsp/lpc2478/drivers/serial.c
浏览文件 @
923fb0c1
...
@@ -62,11 +62,13 @@ void rt_hw_serial_init(void);
...
@@ -62,11 +62,13 @@ void rt_hw_serial_init(void);
void
rt_hw_uart_isr
(
int
irqno
,
void
*
param
)
void
rt_hw_uart_isr
(
int
irqno
,
void
*
param
)
{
{
RT_UNUSED
rt_uint32_t
iir
;
rt_uint32_t
iir
;
struct
rt_lpcserial
*
lpc_serial
=
(
struct
rt_lpcserial
*
)
param
;
struct
rt_lpcserial
*
lpc_serial
=
(
struct
rt_lpcserial
*
)
param
;
RT_ASSERT
(
lpc_serial
!=
RT_NULL
)
RT_ASSERT
(
lpc_serial
!=
RT_NULL
)
RT_UNUSED
(
iir
);
if
(
UART_LSR
(
lpc_serial
->
hw_base
)
&
0x01
)
if
(
UART_LSR
(
lpc_serial
->
hw_base
)
&
0x01
)
{
{
rt_base_t
level
;
rt_base_t
level
;
...
...
bsp/mini4020/drivers/board.c
浏览文件 @
923fb0c1
...
@@ -51,7 +51,9 @@ void rt_serial_handler(int vector, void *param)
...
@@ -51,7 +51,9 @@ void rt_serial_handler(int vector, void *param)
{
{
//rt_kprintf("in rt_serial_handler\n");
//rt_kprintf("in rt_serial_handler\n");
rt_int32_t
stat
=
*
(
RP
)
UART0_IIR
;
rt_int32_t
stat
=
*
(
RP
)
UART0_IIR
;
RT_UNUSED
char
c
;
char
c
;
RT_UNUSED
(
c
);
/*Received data*/
/*Received data*/
if
(((
stat
&
0x0E
)
>>
1
)
==
0x02
)
if
(((
stat
&
0x0E
)
>>
1
)
==
0x02
)
...
...
bsp/mini4020/drivers/sdcard.c
浏览文件 @
923fb0c1
...
@@ -263,11 +263,13 @@ static rt_err_t sd_readblock(rt_uint32_t address, rt_uint8_t *buf)
...
@@ -263,11 +263,13 @@ static rt_err_t sd_readblock(rt_uint32_t address, rt_uint8_t *buf)
U32
complete
,
i
;
U32
complete
,
i
;
rt_uint8_t
temp
;
rt_uint8_t
temp
;
rt_err_t
err
;
rt_err_t
err
;
RT_UNUSED
rt_uint32_t
discard
;
rt_uint32_t
discard
;
#ifdef USE_TIMEOUT
#ifdef USE_TIMEOUT
rt_uint32_t
to
=
10
;
rt_uint32_t
to
=
10
;
#endif
#endif
RT_UNUSED
(
discard
);
//rt_kprintf("in readblock:%x\n",address);
//rt_kprintf("in readblock:%x\n",address);
//Clear all the errors & interrups
//Clear all the errors & interrups
*
(
RP
)
DMAC_INTINTERRCLR
|=
0x1
;
*
(
RP
)
DMAC_INTINTERRCLR
|=
0x1
;
...
...
include/rtdef.h
浏览文件 @
923fb0c1
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
* 2021-03-19 Meco Man add security devices
* 2021-03-19 Meco Man add security devices
* 2021-05-10 armink change version number to v4.0.4
* 2021-05-10 armink change version number to v4.0.4
* 2021-11-19 Meco Man change version number to v4.1.0
* 2021-11-19 Meco Man change version number to v4.1.0
* 2021-12-21 Meco Man re-implement RT_UNUSED
*/
*/
#ifndef __RT_DEF_H__
#ifndef __RT_DEF_H__
...
@@ -118,14 +119,14 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
...
@@ -118,14 +119,14 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define __CLANG_ARM
#define __CLANG_ARM
#endif
#endif
#define RT_UNUSED(x) ((void)x)
/* Compiler Related Definitions */
/* Compiler Related Definitions */
#if defined(__CC_ARM) || defined(__CLANG_ARM)
/* ARM Compiler */
#if defined(__CC_ARM) || defined(__CLANG_ARM)
/* ARM Compiler */
#include <stdarg.h>
#include <stdarg.h>
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_UNUSED __attribute__((unused))
#define RT_USED __attribute__((used))
#define RT_USED __attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
#define ALIGN(n) __attribute__((aligned(n)))
#define RT_WEAK __attribute__((weak))
#define RT_WEAK __attribute__((weak))
#define rt_inline static __inline
#define rt_inline static __inline
/* module compiling */
/* module compiling */
...
@@ -133,19 +134,16 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
...
@@ -133,19 +134,16 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define RTT_API __declspec(dllimport)
#define RTT_API __declspec(dllimport)
#else
#else
#define RTT_API __declspec(dllexport)
#define RTT_API __declspec(dllexport)
#endif
#endif
/* RT_USING_MODULE */
#elif defined (__IAR_SYSTEMS_ICC__)
/* for IAR Compiler */
#elif defined (__IAR_SYSTEMS_ICC__)
/* for IAR Compiler */
#include <stdarg.h>
#include <stdarg.h>
#define RT_SECTION(x) @ x
#define RT_SECTION(x) @ x
#define RT_UNUSED
#define RT_USED __root
#define RT_USED __root
#define PRAGMA(x) _Pragma(#x)
#define PRAGMA(x) _Pragma(#x)
#define ALIGN(n) PRAGMA(data_alignment=n)
#define ALIGN(n) PRAGMA(data_alignment=n)
#define RT_WEAK __weak
#define RT_WEAK __weak
#define rt_inline static inline
#define rt_inline static inline
#define RTT_API
#define RTT_API
#elif defined (__GNUC__)
/* GNU GCC Compiler */
#elif defined (__GNUC__)
/* GNU GCC Compiler */
#ifdef RT_USING_NEWLIB
#ifdef RT_USING_NEWLIB
#include <stdarg.h>
#include <stdarg.h>
...
@@ -156,10 +154,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
...
@@ -156,10 +154,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define va_start(v,l) __builtin_va_start(v,l)
#define va_start(v,l) __builtin_va_start(v,l)
#define va_end(v) __builtin_va_end(v)
#define va_end(v) __builtin_va_end(v)
#define va_arg(v,l) __builtin_va_arg(v,l)
#define va_arg(v,l) __builtin_va_arg(v,l)
#endif
#endif
/* RT_USING_NEWLIB */
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_UNUSED __attribute__((unused))
#define RT_USED __attribute__((used))
#define RT_USED __attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
#define ALIGN(n) __attribute__((aligned(n)))
#define RT_WEAK __attribute__((weak))
#define RT_WEAK __attribute__((weak))
...
@@ -168,7 +164,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
...
@@ -168,7 +164,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#elif defined (__ADSPBLACKFIN__)
/* for VisualDSP++ Compiler */
#elif defined (__ADSPBLACKFIN__)
/* for VisualDSP++ Compiler */
#include <stdarg.h>
#include <stdarg.h>
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_UNUSED __attribute__((unused))
#define RT_USED __attribute__((used))
#define RT_USED __attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
#define ALIGN(n) __attribute__((aligned(n)))
#define RT_WEAK __attribute__((weak))
#define RT_WEAK __attribute__((weak))
...
@@ -177,7 +172,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
...
@@ -177,7 +172,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#elif defined (_MSC_VER)
#elif defined (_MSC_VER)
#include <stdarg.h>
#include <stdarg.h>
#define RT_SECTION(x)
#define RT_SECTION(x)
#define RT_UNUSED
#define RT_USED
#define RT_USED
#define ALIGN(n) __declspec(align(n))
#define ALIGN(n) __declspec(align(n))
#define RT_WEAK
#define RT_WEAK
...
@@ -189,7 +183,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
...
@@ -189,7 +183,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
* GCC and MDK) compilers. See ARM Optimizing C/C++ Compiler 5.9.3 for more
* GCC and MDK) compilers. See ARM Optimizing C/C++ Compiler 5.9.3 for more
* details. */
* details. */
#define RT_SECTION(x)
#define RT_SECTION(x)
#define RT_UNUSED
#define RT_USED
#define RT_USED
#define PRAGMA(x) _Pragma(#x)
#define PRAGMA(x) _Pragma(#x)
#define ALIGN(n)
#define ALIGN(n)
...
@@ -199,7 +192,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
...
@@ -199,7 +192,6 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#elif defined (__TASKING__)
#elif defined (__TASKING__)
#include <stdarg.h>
#include <stdarg.h>
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_SECTION(x) __attribute__((section(x)))
#define RT_UNUSED __attribute__((unused))
#define RT_USED __attribute__((used, protect))
#define RT_USED __attribute__((used, protect))
#define PRAGMA(x) _Pragma(#x)
#define PRAGMA(x) _Pragma(#x)
#define ALIGN(n) __attribute__((__align(n)))
#define ALIGN(n) __attribute__((__align(n)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录