Skip to content

Commit 5e92521

Browse files
committed
struct rt_device_ops 结构体增加宏定义
1 parent c7bdca3 commit 5e92521

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/rtdef.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* 2019-01-27 Bernard change version number to v4.0.1
3333
* 2019-05-17 Bernard change version number to v4.0.2
3434
* 2019-12-20 Bernard change version number to v4.0.3
35+
* 2020-08-10 Meco Man add macro for struct rt_device_ops
3536
*/
3637

3738
#ifndef __RT_DEF_H__
@@ -920,6 +921,8 @@ enum rt_device_class_type
920921
#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x13 /**< set alarm */
921922

922923
typedef struct rt_device *rt_device_t;
924+
925+
#ifdef RT_USING_DEVICE_OPS
923926
/**
924927
* operations set for device object
925928
*/
@@ -933,6 +936,7 @@ struct rt_device_ops
933936
rt_size_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size);
934937
rt_err_t (*control)(rt_device_t dev, int cmd, void *args);
935938
};
939+
#endif
936940

937941
/**
938942
* WaitQueue structure

0 commit comments

Comments
 (0)