Skip to content

Commit 52e43ea

Browse files
committed
[DeviceDriver] Add extern C for cplusplus in rtdevice.h
1 parent bd2d62a commit 52e43ea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/drivers/include/rtdevice.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828

2929
#include <rtthread.h>
3030

31+
#ifdef __cplusplus
32+
extern "C" {
33+
#endif
34+
3135
#define RT_DEVICE(device) ((rt_device_t)device)
3236

3337
/* completion flag */
@@ -362,5 +366,9 @@ rt_inline void rt_work_init(struct rt_work* work, void (*work_func)(struct rt_wo
362366
#include "drivers/pin.h"
363367
#endif
364368

369+
#ifdef __cplusplus
370+
}
371+
#endif
372+
365373
#endif /* __RT_DEVICE_H__ */
366374

0 commit comments

Comments
 (0)