From 109efcbcd5fe63429534aaf9a06a4fb30f76241f Mon Sep 17 00:00:00 2001 From: DavidLin1577 Date: Wed, 23 Jun 2021 14:40:02 +0800 Subject: [components/drivers] added function declaration --- components/drivers/sensors/sensor.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/components/drivers/sensors/sensor.h b/components/drivers/sensors/sensor.h index 761ee49b4c..df70e96690 100755 --- a/components/drivers/sensors/sensor.h +++ b/components/drivers/sensors/sensor.h @@ -6,9 +6,26 @@ * Change Logs: * Date Author Notes * 2019-01-31 flybreak first version + * 2021-06-23 linpeng added function declaration */ +#ifndef __SENSOR_H__ +#define __SENSOR_H__ #include -#include +#ifdef __cplusplus +extern "C" +{ +#endif + +int rt_hw_sensor_register(rt_sensor_t sensor, + const char *name, + rt_uint32_t flag, + void *data); + +#ifdef __cplusplus +} +#endif + +#endif /*__SENSOR_H__*/ -- cgit v1.3.1 From e0b00b21f5be26e1b48fca491c65a38165e4d225 Mon Sep 17 00:00:00 2001 From: DavidLin1577 Date: Tue, 6 Jul 2021 18:03:12 +0800 Subject: [examples/test]update rtc_test.c --- examples/test/rtc_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/test/rtc_test.c b/examples/test/rtc_test.c index 4ed1349de4..79ea8450f9 100644 --- a/examples/test/rtc_test.c +++ b/examples/test/rtc_test.c @@ -20,7 +20,7 @@ int rtc_test(void) rt_kprintf("[RTC Test]RTC Test Start...\n"); rt_thread_delay(RT_TICK_PER_SECOND); - rt_kprintf("[RTC Test]Set RTC 2017-04-01 12:30:46\n\n"); + rt_kprintf("[RTC Test]Set RTC 2017-04-01 12:30:46\n"); rt_thread_delay(RT_TICK_PER_SECOND); ret = set_date(2017, 4, 1); @@ -45,7 +45,7 @@ int rtc_test(void) { rt_kprintf("[RTC Test]Read RTC Date and Time: "); now = time(RT_NULL); - rt_kprintf("%s", ctime(&now)); + rt_kprintf("%s\n", ctime(&now)); rt_thread_delay(RT_TICK_PER_SECOND); } @@ -56,6 +56,6 @@ int rtc_test(void) } #ifdef RT_USING_FINSH #include -FINSH_FUNCTION_EXPORT(rtc_test, rtc drive test. e.g: rtc_test()); -MSH_CMD_EXPORT(rtc_test, rtc drive test. e.g: rtc_test()); +FINSH_FUNCTION_EXPORT(rtc_test, rtc driver test. e.g: rtc_test()); +MSH_CMD_EXPORT(rtc_test, rtc driver test. e.g: rtc_test()); #endif -- cgit v1.3.1 From 04510cfc12a33d3faef7d096ec2f9a557ed46a76 Mon Sep 17 00:00:00 2001 From: David Lin Date: Wed, 7 Jul 2021 09:05:37 +0800 Subject: Update sensor.h --- components/drivers/sensors/sensor.h | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/components/drivers/sensors/sensor.h b/components/drivers/sensors/sensor.h index df70e96690..5f8b451be6 100755 --- a/components/drivers/sensors/sensor.h +++ b/components/drivers/sensors/sensor.h @@ -6,26 +6,7 @@ * Change Logs: * Date Author Notes * 2019-01-31 flybreak first version - * 2021-06-23 linpeng added function declaration */ -#ifndef __SENSOR_H__ -#define __SENSOR_H__ - #include - -#ifdef __cplusplus -extern "C" -{ -#endif - -int rt_hw_sensor_register(rt_sensor_t sensor, - const char *name, - rt_uint32_t flag, - void *data); - -#ifdef __cplusplus -} -#endif - -#endif /*__SENSOR_H__*/ +#include -- cgit v1.3.1 From bfce90ad461328f14a540ee5659a8b2b92f2b617 Mon Sep 17 00:00:00 2001 From: David Lin Date: Wed, 7 Jul 2021 09:06:44 +0800 Subject: Update sensor.h --- components/drivers/sensors/sensor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/drivers/sensors/sensor.h b/components/drivers/sensors/sensor.h index 5f8b451be6..761ee49b4c 100755 --- a/components/drivers/sensors/sensor.h +++ b/components/drivers/sensors/sensor.h @@ -8,5 +8,7 @@ * 2019-01-31 flybreak first version */ + #include #include + -- cgit v1.3.1