From accf881debc50d44e4e447e3142f97fdf1d6adf2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 15 Aug 2024 18:30:24 +1000 Subject: [PATCH] x --- Tools/autotest/test_build_options.py | 49 ++++++++++++++++++---------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/Tools/autotest/test_build_options.py b/Tools/autotest/test_build_options.py index d6d5ff78165dc3..fcc8bb65c7f4d9 100755 --- a/Tools/autotest/test_build_options.py +++ b/Tools/autotest/test_build_options.py @@ -314,24 +314,39 @@ def define_is_whitelisted_for_feature_in_code(self, target, define): if target.lower() not in frozenset(["copter", "rover"]): feature_define_whitelist.add('HAL_SPRAYER_ENABLED') feature_define_whitelist.add('HAL_PROXIMITY_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_CYGBOT_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_DRONECAN_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_LIGHTWARE_SF40C_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_LIGHTWARE_SF45B_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_MAV_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_RANGEFINDER_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_RPLIDARA2_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_TERARANGERTOWER_ENABLED') - feature_define_whitelist.add('AP_PROXIMITY_TERARANGERTOWEREVO_ENABLED') + feature_define_whitelist.add('AP_PROXIMITY_.*_ENABLED') feature_define_whitelist.add('AP_OAPATHPLANNER_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_DODECAHEXA_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_DECA_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_HEXA_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_OCTA_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_QUAD_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_OCTAQUAD_ENABLED') - feature_define_whitelist.add('AP_MOTORS_FRAME_Y6_ENABLED') - return define in feature_define_whitelist + feature_define_whitelist.add('AP_MOTORS_FRAME_.*_ENABLED') + + if target.lower() in ["blimp", "antennatracker"]: + # no airspeed on blimp/tracker + feature_define_whitelist.add(r'AP_AIRSPEED_.*_ENABLED') + feature_define_whitelist.add(r'HAL_MOUNT_ENABLED') + feature_define_whitelist.add(r'AP_MOUNT_.*_ENABLED') + feature_define_whitelist.add(r'HAL_MOUNT_.*_ENABLED') + feature_define_whitelist.add(r'HAL_SOLO_GIMBAL_ENABLED') + feature_define_whitelist.add(r'AP_OPTICALFLOW_ENABLED') + feature_define_whitelist.add(r'AP_OPTICALFLOW_.*_ENABLED') + # missing calls to fence.check(): + feature_define_whitelist.add(r'AP_FENCE_ENABLED') + # RPM not instantiated on Blimp or Rover: + feature_define_whitelist.add(r'AP_RPM_ENABLED') + feature_define_whitelist.add(r'AP_RPM_.*_ENABLED') + + if target.lower() in ["blimp", "antennatracker", "sub"]: + # no OSD on Sub/blimp/tracker + feature_define_whitelist.add(r'OSD_ENABLED') + # camera instantiated in specific vehicles: + feature_define_whitelist.add(r'AP_CAMERA_ENABLED') + feature_define_whitelist.add(r'AP_CAMERA_.*_ENABLED') + + if target.lower() in ["antennatracker"]: + # missing the init call to the relay library: + feature_define_whitelist.add(r'AP_RELAY_ENABLED') + + for some_re in feature_define_whitelist: + if re.match(some_re, define): + return True def assert_feature_in_code(self, defines, feature): # if the feature is truly disabled then extract_features.py