From eae4394329c46a3e5e3463ae5f5ba64c368cfadb Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Tue, 12 Feb 2019 14:16:27 +0800 Subject: [PATCH] add "extern "C" {}" for c++ --- components/drivers/sensors/sensor.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/drivers/sensors/sensor.h b/components/drivers/sensors/sensor.h index 15dd79ccdf..f505a27e1d 100644 --- a/components/drivers/sensors/sensor.h +++ b/components/drivers/sensors/sensor.h @@ -14,6 +14,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef RT_USING_RTC #define rt_sen_get_timestamp() time() /* API for the sensor to get the timestamp */ #else @@ -189,4 +193,9 @@ int rt_hw_sensor_register(rt_sensor_t sensor, const char *name, rt_uint32_t flag, void *data); + +#ifdef __cplusplus +} #endif + +#endif /* __SENSOR_H__ */