summaryrefslogtreecommitdiff
path: root/components/drivers/sensor/SConscript
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2024-03-16 19:02:35 -0400
committerMeco Man <[email protected]>2024-03-16 23:31:54 -0400
commit9ac8b47eb26b0d6a2ba2085e547af5c090e619a8 (patch)
tree79483ca719b07852c40a49f65e8bdb28e575da4e /components/drivers/sensor/SConscript
parentb3e073864fcc93d7f4431a3b9be006bc967f5240 (diff)
[sensor-v2] enable sensor v2
fix the confilcts with sensor v1
Diffstat (limited to 'components/drivers/sensor/SConscript')
-rw-r--r--components/drivers/sensor/SConscript24
1 files changed, 14 insertions, 10 deletions
diff --git a/components/drivers/sensor/SConscript b/components/drivers/sensor/SConscript
index 4c815c49b8..59f0a0b792 100644
--- a/components/drivers/sensor/SConscript
+++ b/components/drivers/sensor/SConscript
@@ -1,15 +1,19 @@
-# RT-Thread building script for bridge
+# SConscript for sensor framework
-import os
from building import *
+import os
+
+src = []
-cwd = GetCurrentDir()
-objs = []
-list = os.listdir(cwd)
+if GetDepend('RT_USING_SENSOR_V2'):
+ src += [os.path.join('v2', 'sensor.c')]
+ if GetDepend('RT_USING_SENSOR_CMD'):
+ 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')]
-for d in list:
- path = os.path.join(cwd, d)
- if os.path.isfile(os.path.join(path, 'SConscript')):
- objs = objs + SConscript(os.path.join(d, 'SConscript'))
+group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SENSOR'])
-Return('objs')
+Return('group')