[sensor-v2] enable sensor v2

fix the confilcts with sensor v1
This commit is contained in:
Meco Man 2024-03-16 19:02:35 -04:00
parent b3e073864f
commit 9ac8b47eb2
6 changed files with 18 additions and 37 deletions

View File

@ -14,6 +14,7 @@ CONFIG_PKG_USING_ARDUINO_ADAFRUIT_MAX6675=y
CONFIG_PKG_USING_ARDUINO_ADAFRUIT_MLX90614=y CONFIG_PKG_USING_ARDUINO_ADAFRUIT_MLX90614=y
CONFIG_PKG_USING_ARDUINO_ADAFRUIT_LSM9DS1=y CONFIG_PKG_USING_ARDUINO_ADAFRUIT_LSM9DS1=y
CONFIG_PKG_USING_ARDUINO_ADAFRUIT_AHTX0=y CONFIG_PKG_USING_ARDUINO_ADAFRUIT_AHTX0=y
CONFIG_ARDUINO_ADAFRUIT_AHTX0_USING_SENSOR_DEVICE=y
CONFIG_PKG_USING_ARDUINO_ADAFRUIT_LSM9DS0=y CONFIG_PKG_USING_ARDUINO_ADAFRUIT_LSM9DS0=y
CONFIG_PKG_USING_ARDUINO_ADAFRUIT_BMP280=y CONFIG_PKG_USING_ARDUINO_ADAFRUIT_BMP280=y
CONFIG_PKG_USING_ARDUINO_ADAFRUIT_ADT7410=y CONFIG_PKG_USING_ARDUINO_ADAFRUIT_ADT7410=y

View File

@ -557,9 +557,9 @@ config RT_USING_SENSOR
default n default n
if RT_USING_SENSOR if RT_USING_SENSOR
# config RT_USING_SENSOR_V2 config RT_USING_SENSOR_V2
# bool "Enable Sensor Framework v2" bool "Enable Sensor Framework v2"
# default n default n
config RT_USING_SENSOR_CMD config RT_USING_SENSOR_CMD
bool "Using Sensor cmd" bool "Using Sensor cmd"

View File

@ -1,15 +1,19 @@
# RT-Thread building script for bridge # SConscript for sensor framework
import os
from building import * from building import *
import os
cwd = GetCurrentDir() src = []
objs = []
list = os.listdir(cwd)
for d in list: if GetDepend('RT_USING_SENSOR_V2'):
path = os.path.join(cwd, d) src += [os.path.join('v2', 'sensor.c')]
if os.path.isfile(os.path.join(path, 'SConscript')): if GetDepend('RT_USING_SENSOR_CMD'):
objs = objs + SConscript(os.path.join(d, 'SConscript')) src += [os.path.join('v2', 'sensor_cmd.c')]
else:
src += [os.path.join('v1', 'sensor.c')]
if GetDepend('RT_USING_SENSOR_CMD'):
src += [os.path.join('v1', 'sensor_cmd.c')]
Return('objs') group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SENSOR'])
Return('group')

View File

@ -1,12 +0,0 @@
# SConscript for sensor framework
from building import *
src = ['sensor.c']
if GetDepend('RT_USING_SENSOR_CMD'):
src += ['sensor_cmd.c']
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SENSOR'])
Return('group')

View File

@ -1,12 +0,0 @@
# SConscript for sensor framework
from building import *
src = ['sensor_v2.c']
if GetDepend('RT_USING_SENSOR_CMD'):
src += ['sensor_cmd.c']
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SENSOR_V2'])
Return('group')