modify sensor framework kconfig function

This commit is contained in:
Liu_Weichao 2021-09-08 13:34:25 +08:00
parent 6fc420e6a3
commit 281482855d
20 changed files with 22 additions and 87 deletions

View File

@ -49,7 +49,7 @@ static int AppInitDesc(struct InitDesc sub_desc[])
static struct InitDesc framework[] =
{
#ifdef SUPPORT_SENSOR_FRAMEWORK
{ "perception_framework", SensorFrameworkInit },
{ "sensor_framework", SensorFrameworkInit },
#endif
#ifdef SUPPORT_CONNECTION_FRAMEWORK
@ -59,13 +59,13 @@ static struct InitDesc framework[] =
{ "NULL", NULL },
};
static struct InitDesc perception_desc[] =
static struct InitDesc sensor_desc[] =
{
#ifdef PERCEPTION_D124
#ifdef SENSOR_DEVICE_ZG09
{ "d124_voice", D124VoiceInit },
#endif
#ifdef PERCEPTION_HS300X
#ifdef SENSOR_DEVICE_HS300X
#ifdef SENSOR_QUANTITY_HS300X_TEMPERATURE
{ "hs300x_temperature", Hs300xTemperatureInit },
#endif
@ -74,13 +74,13 @@ static struct InitDesc perception_desc[] =
#endif
#endif
#ifdef PERCEPTION_PS5308
#ifdef SENSOR_PS5308
#ifdef SENSOR_QUANTITY_PS5308_PM1_0
{ "ps5308_pm1_0", Ps5308Pm1_0Init },
#endif
#endif
#ifdef PERCEPTION_ZG09
#ifdef SENSOR_ZG09
{ "zg09_co2", Zg09Co2Init },
#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
*
*/
static int PerceptionFrameworkInit(struct InitDesc sub_desc[])
static int SensorDeviceFrameworkInit(struct InitDesc sub_desc[])
{
int i = 0;
int ret = 0;
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();
break;
}
}
if (0 == ret) {
printf("initialize perception_framework success.\n");
AppInitDesc(perception_desc);
printf("initialize sensor_framework success.\n");
AppInitDesc(sensor_desc);
}
return ret;
@ -127,7 +127,7 @@ static int PerceptionFrameworkInit(struct InitDesc sub_desc[])
* @param sub_desc framework
*
*/
static int ConnectionFrameworkInit(struct InitDesc sub_desc[])
static int ConnectionDeviceFrameworkInit(struct InitDesc sub_desc[])
{
int i = 0;
int ret = 0;
@ -153,11 +153,11 @@ static int ConnectionFrameworkInit(struct InitDesc sub_desc[])
int FrameworkInit()
{
#ifdef SUPPORT_SENSOR_FRAMEWORK
PerceptionFrameworkInit(framework);
SensorDeviceFrameworkInit(framework);
#endif
#ifdef SUPPORT_CONNECTION_FRAMEWORK
ConnectionFrameworkInit(framework);
ConnectionDeviceFrameworkInit(framework);
#endif
return 0;

View File

@ -3,67 +3,56 @@ menu "sensor app"
menuconfig APPLICATION_SENSOR
bool "Using sensor apps"
default n
select PERCEPTION_SENSORDEVICE
if APPLICATION_SENSOR
menuconfig APPLICATION_SENSOR_CO2
bool "Using sensor CO2 apps"
default n
select PERCEPTION_CO2
if APPLICATION_SENSOR_CO2
config APPLICATION_SENSOR_CO2_ZG09
bool "Using sensor ZG09 apps"
default n
select PERCEPTION_ZG09
endif
menuconfig APPLICATION_SENSOR_PM1_0
bool "Using sensor PM1.0 apps"
default n
select PERCEPTION_PM
if APPLICATION_SENSOR_PM1_0
config APPLICATION_SENSOR_PM1_0_PS5308
bool "Using sensor PS5308 apps"
default n
select PERCEPTION_PS5308
endif
menuconfig APPLICATION_SENSOR_VOICE
bool "Using sensor voice apps"
default n
select PERCEPTION_VOICE
if APPLICATION_SENSOR_VOICE
config APPLICATION_SENSOR_VOICE_D124
bool "Using sensor D124 apps"
default n
select PERCEPTION_D124
endif
menuconfig APPLICATION_SENSOR_HUMIDITY
bool "Using sensor humidity apps"
default n
select PERCEPTION_HUMIDITY
if APPLICATION_SENSOR_HUMIDITY
config APPLICATION_SENSOR_HUMIDITY_HS300X
bool "Using sensor HS300x apps"
default n
select PERCEPTION_HS300X
endif
menuconfig APPLICATION_SENSOR_TEMPERATURE
bool "Using sensor temperature apps"
default n
select PERCEPTION_TEMPERATURE
if APPLICATION_SENSOR_TEMPERATURE
config APPLICATION_SENSOR_TEMPERATURE_HS300X
bool "Using sensor HS300x apps"
default n
select PERCEPTION_HS300X
endif
endif

View File

@ -12,7 +12,7 @@
/**
* @file zg09.c
* @brief ZG09 CO2 driver base perception
* @brief ZG09 CO2 driver base sensor
* @version 1.0
* @author AIIT XUOS Lab
* @date 2021.04.22

View File

@ -1,9 +1,9 @@
config PERCEPTION_HS300X
config SENSOR_HS300X
bool "Using HS300x"
default n
if PERCEPTION_HS300X
if SENSOR_HS300X
config SENSOR_DEVICE_HS300X
string "HS300x sensor name"
default "hs300x_1"

View File

@ -12,7 +12,7 @@
/**
* @file hs300x_humi.c
* @brief HS300x humidity driver base perception
* @brief HS300x humidity driver base sensor
* @version 1.0
* @author AIIT XUOS Lab
* @date 2021.04.22

View File

@ -12,7 +12,7 @@
/**
* @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
* @author AIIT XUOS Lab
* @date 2021.04.22

View File

@ -33,7 +33,7 @@ static pthread_mutex_t quant_table_lock;
static pthread_mutex_t sensor_device_list_lock;
/**
* @description: Init perception framework
* @description: Init sensor framework
* @return 0
*/
int SensorFrameworkInit(void)

View File

@ -12,7 +12,7 @@
/**
* @file hs300x_temp.c
* @brief HS300x temperature driver base perception
* @brief HS300x temperature driver base sensor
* @version 1.0
* @author AIIT XUOS Lab
* @date 2021.04.22

View File

@ -12,7 +12,7 @@
/**
* @file d124.c
* @brief D124 voice driver base perception
* @brief D124 voice driver base sensor
* @version 1.0
* @author AIIT XUOS Lab
* @date 2021.04.22

View File

@ -187,11 +187,6 @@ CONFIG_FS_VFS_DEVFS=y
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -235,11 +235,6 @@ CONFIG_FS_VFS_DEVFS=y
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -210,11 +210,6 @@ CONFIG_FS_DFS=n
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -208,11 +208,6 @@ CONFIG_FS_DFS=n
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -208,11 +208,6 @@ CONFIG_FS_DFS=n
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -200,11 +200,6 @@ CONFIG_FS_VFS_DEVFS=y
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -200,11 +200,6 @@ CONFIG_FS_VFS_DEVFS=y
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -201,11 +201,6 @@ CONFIG_FS_VFS_DEVFS=y
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -185,11 +185,6 @@ CONFIG_FS_VFS_DEVFS=y
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -186,11 +186,6 @@ CONFIG_FS_VFS_DEVFS=y
# APP Framework
#
#
# Perception
#
# CONFIG_PERCEPTION_SENSORDEVICE is not set
#
# connection
#

View File

@ -164,10 +164,6 @@ ifeq ($(CONFIG_FS_CH376), y)
KERNELPATHS +=-I$(KERNEL_ROOT)/fs/compatibility_ch376 #
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/sensor #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xiuos #