forked from xuos/xiuos
modify sensor framework kconfig function
This commit is contained in:
parent
6fc420e6a3
commit
281482855d
|
@ -49,7 +49,7 @@ static int AppInitDesc(struct InitDesc sub_desc[])
|
||||||
static struct InitDesc framework[] =
|
static struct InitDesc framework[] =
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_SENSOR_FRAMEWORK
|
#ifdef SUPPORT_SENSOR_FRAMEWORK
|
||||||
{ "perception_framework", SensorFrameworkInit },
|
{ "sensor_framework", SensorFrameworkInit },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SUPPORT_CONNECTION_FRAMEWORK
|
#ifdef SUPPORT_CONNECTION_FRAMEWORK
|
||||||
|
@ -59,13 +59,13 @@ static struct InitDesc framework[] =
|
||||||
{ "NULL", NULL },
|
{ "NULL", NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct InitDesc perception_desc[] =
|
static struct InitDesc sensor_desc[] =
|
||||||
{
|
{
|
||||||
#ifdef PERCEPTION_D124
|
#ifdef SENSOR_DEVICE_ZG09
|
||||||
{ "d124_voice", D124VoiceInit },
|
{ "d124_voice", D124VoiceInit },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PERCEPTION_HS300X
|
#ifdef SENSOR_DEVICE_HS300X
|
||||||
#ifdef SENSOR_QUANTITY_HS300X_TEMPERATURE
|
#ifdef SENSOR_QUANTITY_HS300X_TEMPERATURE
|
||||||
{ "hs300x_temperature", Hs300xTemperatureInit },
|
{ "hs300x_temperature", Hs300xTemperatureInit },
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,13 +74,13 @@ static struct InitDesc perception_desc[] =
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PERCEPTION_PS5308
|
#ifdef SENSOR_PS5308
|
||||||
#ifdef SENSOR_QUANTITY_PS5308_PM1_0
|
#ifdef SENSOR_QUANTITY_PS5308_PM1_0
|
||||||
{ "ps5308_pm1_0", Ps5308Pm1_0Init },
|
{ "ps5308_pm1_0", Ps5308Pm1_0Init },
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PERCEPTION_ZG09
|
#ifdef SENSOR_ZG09
|
||||||
{ "zg09_co2", Zg09Co2Init },
|
{ "zg09_co2", Zg09Co2Init },
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -99,24 +99,24 @@ static struct InitDesc connection_desc[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function will init perception framework and all sub perception sensors
|
* This function will init sensor framework and all sub sensors
|
||||||
* @param sub_desc framework
|
* @param sub_desc framework
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int PerceptionFrameworkInit(struct InitDesc sub_desc[])
|
static int SensorDeviceFrameworkInit(struct InitDesc sub_desc[])
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
for ( i = 0; sub_desc[i].fn != NULL; i++ ) {
|
for ( i = 0; sub_desc[i].fn != NULL; i++ ) {
|
||||||
if (0 == strncmp(sub_desc[i].fn_name, "perception_framework", strlen("perception_framework"))) {
|
if (0 == strncmp(sub_desc[i].fn_name, "sensor_framework", strlen("sensor_framework"))) {
|
||||||
ret = sub_desc[i].fn();
|
ret = sub_desc[i].fn();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == ret) {
|
if (0 == ret) {
|
||||||
printf("initialize perception_framework success.\n");
|
printf("initialize sensor_framework success.\n");
|
||||||
AppInitDesc(perception_desc);
|
AppInitDesc(sensor_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -127,7 +127,7 @@ static int PerceptionFrameworkInit(struct InitDesc sub_desc[])
|
||||||
* @param sub_desc framework
|
* @param sub_desc framework
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int ConnectionFrameworkInit(struct InitDesc sub_desc[])
|
static int ConnectionDeviceFrameworkInit(struct InitDesc sub_desc[])
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -153,11 +153,11 @@ static int ConnectionFrameworkInit(struct InitDesc sub_desc[])
|
||||||
int FrameworkInit()
|
int FrameworkInit()
|
||||||
{
|
{
|
||||||
#ifdef SUPPORT_SENSOR_FRAMEWORK
|
#ifdef SUPPORT_SENSOR_FRAMEWORK
|
||||||
PerceptionFrameworkInit(framework);
|
SensorDeviceFrameworkInit(framework);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SUPPORT_CONNECTION_FRAMEWORK
|
#ifdef SUPPORT_CONNECTION_FRAMEWORK
|
||||||
ConnectionFrameworkInit(framework);
|
ConnectionDeviceFrameworkInit(framework);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -3,67 +3,56 @@ menu "sensor app"
|
||||||
menuconfig APPLICATION_SENSOR
|
menuconfig APPLICATION_SENSOR
|
||||||
bool "Using sensor apps"
|
bool "Using sensor apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_SENSORDEVICE
|
|
||||||
|
|
||||||
if APPLICATION_SENSOR
|
if APPLICATION_SENSOR
|
||||||
menuconfig APPLICATION_SENSOR_CO2
|
menuconfig APPLICATION_SENSOR_CO2
|
||||||
bool "Using sensor CO2 apps"
|
bool "Using sensor CO2 apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_CO2
|
|
||||||
|
|
||||||
if APPLICATION_SENSOR_CO2
|
if APPLICATION_SENSOR_CO2
|
||||||
config APPLICATION_SENSOR_CO2_ZG09
|
config APPLICATION_SENSOR_CO2_ZG09
|
||||||
bool "Using sensor ZG09 apps"
|
bool "Using sensor ZG09 apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_ZG09
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
menuconfig APPLICATION_SENSOR_PM1_0
|
menuconfig APPLICATION_SENSOR_PM1_0
|
||||||
bool "Using sensor PM1.0 apps"
|
bool "Using sensor PM1.0 apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_PM
|
|
||||||
|
|
||||||
if APPLICATION_SENSOR_PM1_0
|
if APPLICATION_SENSOR_PM1_0
|
||||||
config APPLICATION_SENSOR_PM1_0_PS5308
|
config APPLICATION_SENSOR_PM1_0_PS5308
|
||||||
bool "Using sensor PS5308 apps"
|
bool "Using sensor PS5308 apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_PS5308
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
menuconfig APPLICATION_SENSOR_VOICE
|
menuconfig APPLICATION_SENSOR_VOICE
|
||||||
bool "Using sensor voice apps"
|
bool "Using sensor voice apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_VOICE
|
|
||||||
|
|
||||||
if APPLICATION_SENSOR_VOICE
|
if APPLICATION_SENSOR_VOICE
|
||||||
config APPLICATION_SENSOR_VOICE_D124
|
config APPLICATION_SENSOR_VOICE_D124
|
||||||
bool "Using sensor D124 apps"
|
bool "Using sensor D124 apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_D124
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
menuconfig APPLICATION_SENSOR_HUMIDITY
|
menuconfig APPLICATION_SENSOR_HUMIDITY
|
||||||
bool "Using sensor humidity apps"
|
bool "Using sensor humidity apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_HUMIDITY
|
|
||||||
|
|
||||||
if APPLICATION_SENSOR_HUMIDITY
|
if APPLICATION_SENSOR_HUMIDITY
|
||||||
config APPLICATION_SENSOR_HUMIDITY_HS300X
|
config APPLICATION_SENSOR_HUMIDITY_HS300X
|
||||||
bool "Using sensor HS300x apps"
|
bool "Using sensor HS300x apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_HS300X
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
menuconfig APPLICATION_SENSOR_TEMPERATURE
|
menuconfig APPLICATION_SENSOR_TEMPERATURE
|
||||||
bool "Using sensor temperature apps"
|
bool "Using sensor temperature apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_TEMPERATURE
|
|
||||||
|
|
||||||
if APPLICATION_SENSOR_TEMPERATURE
|
if APPLICATION_SENSOR_TEMPERATURE
|
||||||
config APPLICATION_SENSOR_TEMPERATURE_HS300X
|
config APPLICATION_SENSOR_TEMPERATURE_HS300X
|
||||||
bool "Using sensor HS300x apps"
|
bool "Using sensor HS300x apps"
|
||||||
default n
|
default n
|
||||||
select PERCEPTION_HS300X
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file zg09.c
|
* @file zg09.c
|
||||||
* @brief ZG09 CO2 driver base perception
|
* @brief ZG09 CO2 driver base sensor
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @author AIIT XUOS Lab
|
* @author AIIT XUOS Lab
|
||||||
* @date 2021.04.22
|
* @date 2021.04.22
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
config PERCEPTION_HS300X
|
config SENSOR_HS300X
|
||||||
bool "Using HS300x"
|
bool "Using HS300x"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
if PERCEPTION_HS300X
|
if SENSOR_HS300X
|
||||||
config SENSOR_DEVICE_HS300X
|
config SENSOR_DEVICE_HS300X
|
||||||
string "HS300x sensor name"
|
string "HS300x sensor name"
|
||||||
default "hs300x_1"
|
default "hs300x_1"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file hs300x_humi.c
|
* @file hs300x_humi.c
|
||||||
* @brief HS300x humidity driver base perception
|
* @brief HS300x humidity driver base sensor
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @author AIIT XUOS Lab
|
* @author AIIT XUOS Lab
|
||||||
* @date 2021.04.22
|
* @date 2021.04.22
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file ps5308.c
|
* @file ps5308.c
|
||||||
* @brief PS5308 PM1.0, PM2.5, PM10, driver base perception
|
* @brief PS5308 PM1.0, PM2.5, PM10, driver base sensor
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @author AIIT XUOS Lab
|
* @author AIIT XUOS Lab
|
||||||
* @date 2021.04.22
|
* @date 2021.04.22
|
||||||
|
|
|
@ -33,7 +33,7 @@ static pthread_mutex_t quant_table_lock;
|
||||||
static pthread_mutex_t sensor_device_list_lock;
|
static pthread_mutex_t sensor_device_list_lock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: Init perception framework
|
* @description: Init sensor framework
|
||||||
* @return 0
|
* @return 0
|
||||||
*/
|
*/
|
||||||
int SensorFrameworkInit(void)
|
int SensorFrameworkInit(void)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file hs300x_temp.c
|
* @file hs300x_temp.c
|
||||||
* @brief HS300x temperature driver base perception
|
* @brief HS300x temperature driver base sensor
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @author AIIT XUOS Lab
|
* @author AIIT XUOS Lab
|
||||||
* @date 2021.04.22
|
* @date 2021.04.22
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file d124.c
|
* @file d124.c
|
||||||
* @brief D124 voice driver base perception
|
* @brief D124 voice driver base sensor
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @author AIIT XUOS Lab
|
* @author AIIT XUOS Lab
|
||||||
* @date 2021.04.22
|
* @date 2021.04.22
|
||||||
|
|
|
@ -187,11 +187,6 @@ CONFIG_FS_VFS_DEVFS=y
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -235,11 +235,6 @@ CONFIG_FS_VFS_DEVFS=y
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -210,11 +210,6 @@ CONFIG_FS_DFS=n
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -208,11 +208,6 @@ CONFIG_FS_DFS=n
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -208,11 +208,6 @@ CONFIG_FS_DFS=n
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -200,11 +200,6 @@ CONFIG_FS_VFS_DEVFS=y
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -200,11 +200,6 @@ CONFIG_FS_VFS_DEVFS=y
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -201,11 +201,6 @@ CONFIG_FS_VFS_DEVFS=y
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -185,11 +185,6 @@ CONFIG_FS_VFS_DEVFS=y
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -186,11 +186,6 @@ CONFIG_FS_VFS_DEVFS=y
|
||||||
# APP Framework
|
# APP Framework
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# Perception
|
|
||||||
#
|
|
||||||
# CONFIG_PERCEPTION_SENSORDEVICE is not set
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# connection
|
# connection
|
||||||
#
|
#
|
||||||
|
|
|
@ -164,10 +164,6 @@ ifeq ($(CONFIG_FS_CH376), y)
|
||||||
KERNELPATHS +=-I$(KERNEL_ROOT)/fs/compatibility_ch376 #
|
KERNELPATHS +=-I$(KERNEL_ROOT)/fs/compatibility_ch376 #
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# ifeq ($(CONFIG_PERCEPTION_SENSORDEVICE), y)
|
|
||||||
# KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/sensor #
|
|
||||||
# endif
|
|
||||||
|
|
||||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xiuos/user_api/posix_support/include #
|
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xiuos/user_api/posix_support/include #
|
||||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/sensor #
|
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/sensor #
|
||||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xiuos #
|
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xiuos #
|
||||||
|
|
Loading…
Reference in New Issue