add kconfig for application framework

This commit is contained in:
Wang_Weigen 2021-06-18 17:37:03 +08:00
parent 4510a95e90
commit 96af003398
38 changed files with 214 additions and 150 deletions

View File

@ -11,83 +11,10 @@ menu "Applications"
default 85 if KTASK_PRIORITY_256
endmenu
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
menuconfig CONNECTION_COMMUNICATION_ZIGBEE
bool "enable zigbee demo"
default n
select CONFIG_CONNECTION_COMMUNICATION_ZIGBEE
if CONNECTION_COMMUNICATION_ZIGBEE
source "$KERNEL_DIR/framework/connection/Adapter/zigbee/Kconfig"
endif
source "$APP_DIR/Applications/app_test/Kconfig"
source "$APP_DIR/Applications/app_test/Kconfig"
source "$APP_DIR/Applications/connection_app/Kconfig"
source "$APP_DIR/Applications/control_app/Kconfig"
source "$APP_DIR/Applications/knowing_app/Kconfig"
source "$APP_DIR/Applications/sensor_app/Kconfig"
endmenu

View File

@ -2,44 +2,20 @@ SRC_DIR := general_functions
SRC_FILES := main.c framework_init.c
ifeq ($(CONFIG_RESOURCES_SDIO), y)
SRC_FILES += sd_card_mount.c
endif
ifeq ($(CONFIG_RESOURCES_SPI_SD), y)
SRC_FILES += spi_sd_card_mount.c
endif
ifeq ($(CONFIG_CONNECTION_COMMUNICATION_BOOTSTART_LORA_NET_SAMPLE), y)
SRC_DIR += connection_demo/adhoc_lora_demo
endif
ifeq ($(CONFIG_CONNECTION_COMMUNICATION_ZIGBEE), y)
SRC_DIR += connection_demo/zigbee_demo
endif
ifeq ($(CONFIG_CONNECTION_COMMUNICATION_ETHERNET), y)
SRC_DIR += connection_demo/ethernet_demo
endif
ifeq ($(CONFIG_CONNECTION_COMMUNICATION_WIFI), y)
SRC_DIR += connection_demo/wifi_demo
endif
ifeq ($(CONFIG_CONNECTION_COMMUNICATION_NB_IOT), y)
SRC_DIR += connection_demo/nbiot_demo
endif
# ifeq ($(CONFIG_CONNECTION_COMMUNICATION_4G), y)
# SRC_DIR += connection_demo/4G_demo
# endif
ifeq ($(CONFIG_CONNECTION_COMMUNICATION_BLUETOOTH), y)
SRC_DIR += connection_demo/bluetooth_demo
endif
ifeq ($(CONFIG_APPLICATION_SENSOR),y)
SRC_DIR += sensor_app
endif
ifeq ($(CONFIG_APPLICATION_CONNECTION),y)
SRC_DIR += connection_app
endif
ifeq ($(CONFIG_APPLICATION_KNOWING),y)
SRC_DIR += knowing_app
endif
ifeq ($(CONFIG_APPLICATION_CONTROL),y)
SRC_DIR += control_app
endif
include $(KERNEL_ROOT)/compiler.mk

View File

@ -1,18 +1,20 @@
menuconfig USER_TEST
bool "Enable application test function "
default n
menu "test app"
menuconfig USER_TEST
bool "Enable application test function "
default n
if USER_TEST
config USER_TEST_LORA_ADHOC
bool "Config test lora adhoc"
default n
if USER_TEST
config USER_TEST_LORA_ADHOC
bool "Config test lora adhoc"
default n
config USER_TEST_SPI_LORA
bool "Config test spi lora"
default n
config USER_TEST_SPI_LORA
bool "Config test spi lora"
default n
config USER_TEST_SPI_FLASH
bool "Config test spi flash"
default n
config USER_TEST_SPI_FLASH
bool "Config test spi flash"
default n
endif
endif
endmenu

View File

@ -0,0 +1,14 @@
menu "connection app"
menuconfig APPLICATION_CONNECTION
bool "Using connection apps"
default n
menuconfig CONNECTION_COMMUNICATION_ZIGBEE
bool "enable zigbee demo"
default n
select CONFIG_CONNECTION_COMMUNICATION_ZIGBEE
if CONNECTION_COMMUNICATION_ZIGBEE
source "$KERNEL_DIR/framework/connection/Adapter/zigbee/Kconfig"
endif
endmenu

View File

@ -0,0 +1,8 @@
menu "control app"
menuconfig APPLICATION_CONTROL
bool "Using control apps"
default n
endmenu

View File

@ -0,0 +1,7 @@
menu "knowing app"
menuconfig APPLICATION_KNOWING
bool "Using knowing apps"
default n
endmenu

View File

@ -0,0 +1,70 @@
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
endmenu

View File

@ -1,22 +1,27 @@
config TRANSFORM_LAYER_ATTRIUBUTE
bool "support transform layer"
default y
choice
prompt "select os features"
default ADD_XIUOS_FETURES
menu "Framework"
config ADD_XIUOS_FETURES
bool "add xiuos fetures"
config ADD_NUTTX_FETURES
bool "add nuttx fetures"
config TRANSFORM_LAYER_ATTRIUBUTE
bool "support transform layer"
default y
choice
prompt "select os features"
default ADD_XIUOS_FETURES
config ADD_RTTHREAD_FETURES
bool "add rt_thread fetures"
endchoice
config ADD_XIUOS_FETURES
bool "add xiuos fetures"
config ADD_NUTTX_FETURES
bool "add nuttx fetures"
config ADD_RTTHREAD_FETURES
bool "add rt_thread fetures"
endchoice
source "$APP_DIR/Framework/sensor/Kconfig"
source "$APP_DIR/Framework/connection/Kconfig"
source "$APP_DIR/Framework/know/tflite_sin/Kconfig"
source "$APP_DIR/Framework/know/tflite_mnist/Kconfig"
source "$APP_DIR/Framework/sensor/Kconfig"
source "$APP_DIR/Framework/connection/Kconfig"
source "$APP_DIR/Framework/know/Kconfig"
source "$APP_DIR/Framework/control/Kconfig"
endmenu

View File

@ -8,5 +8,14 @@ ifeq ($(CONFIG_SUPPORT_CONNECTION_FRAMEWORK),y)
SRC_DIR += connection
endif
ifeq ($(CONFIG_SUPPORT_KNOWING_FRAMEWORK),y)
SRC_DIR += know
endif
ifeq ($(CONFIG_SUPPORT_CONTROL_FRAMEWORK),y)
SRC_DIR += control
endif
include $(KERNEL_ROOT)/compiler.mk

View File

@ -0,0 +1,3 @@
menuconfig SUPPORT_CONTROL_FRAMEWORK
bool "support control framework"
default n

View File

@ -0,0 +1,3 @@
SRC_DIR :=
include $(KERNEL_ROOT)/compiler.mk

View File

@ -0,0 +1,8 @@
menuconfig SUPPORT_KNOWING_FRAMEWORK
bool "support knowing framework"
default y
if SUPPORT_KNOWING_FRAMEWORK
source "$APP_DIR/Framework/know/tflite_sin/Kconfig"
source "$APP_DIR/Framework/know/tflite_mnist/Kconfig"
endif

View File

@ -0,0 +1,13 @@
SRC_DIR :=
ifeq ($(CONFIG_SUPPORT_KNOW_FRAMEWORK),y)
ifeq ($(CONFIG_USING_TFLITE_MNIST),y)
SRC_DIR += tflite_mnist
endif
ifeq ($(CONFIG_USING_TFLITE_SIN),y)
SRC_DIR += tflite_sin
endif
endif
include $(KERNEL_ROOT)/compiler.mk

View File

@ -1,4 +1,4 @@
config USING_TFLITE_MNIST
menuconfig USING_TFLITE_MNIST
bool "mnist demo app for tflite micro"
depends on INTELLIGENT_TFLITE
default n

View File

@ -1,4 +1,4 @@
config USING_TFLITE_SIN
menuconfig USING_TFLITE_SIN
bool "sin(x) demo app for tflite micro"
depends on INTELLIGENT_TFLITE
default n

View File

@ -7,5 +7,7 @@ menu "APP_Framework"
source "$APP_DIR/Applications/Kconfig"
source "$APP_DIR/Framework/Kconfig"
source "$APP_DIR/lib/Kconfig"
endmenu

14
APP_Framework/lib/Kconfig Executable file
View File

@ -0,0 +1,14 @@
menu "app lib"
choice
prompt "chose a kind of lib for app"
default APP_SELECT_NEWLIB
config APP_SELECT_NEWLIB
bool "app select newlib"
config APP_SELECT_OTHER_LIB
bool "app select other lib"
endchoice
endmenu

View File

@ -1,7 +1,10 @@
SRC_DIR :=
ifeq ($(CONFIG_SEPARATE_COMPILE),y)
SRC_DIR += app_newlib
ifeq ($(CONFIG_APP_SELECT_NEWLIB),y)
ifeq ($(CONFIG_SEPARATE_COMPILE),y)
SRC_DIR += app_newlib
endif
endif
include $(KERNEL_ROOT)/compiler.mk