Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fixes when features disabled / feature extraction fixes #29007

Merged
merged 11 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Tools/autotest/test_build_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def define_is_whitelisted_for_feature_in_code(self, target, define):
feature_define_whitelist.add('AP_WINCH_PWM_ENABLED')
feature_define_whitelist.add(r'AP_MOTORS_FRAME_.*_ENABLED')
feature_define_whitelist.add('AP_COPTER_ADVANCED_FAILSAFE_ENABLED')
feature_define_whitelist.add('AP_INERTIALSENSOR_FAST_SAMPLE_WINDOW_ENABLED')

if target.lower() != "plane":
# only on Plane:
Expand All @@ -304,6 +305,9 @@ def define_is_whitelisted_for_feature_in_code(self, target, define):
feature_define_whitelist.add('AP_PLANE_OFFBOARD_GUIDED_SLEW_ENABLED')
feature_define_whitelist.add('HAL_QUADPLANE_ENABLED')
feature_define_whitelist.add('AP_BATTERY_WATT_MAX_ENABLED')
feature_define_whitelist.add('MODE_AUTOLAND_ENABLED')
feature_define_whitelist.add('AP_PLANE_GLIDER_PULLUP_ENABLED')
feature_define_whitelist.add('AP_QUICKTUNE_ENABLED')

if target.lower() not in ["plane", "copter"]:
feature_define_whitelist.add('HAL_ADSB_ENABLED')
Expand Down
8 changes: 4 additions & 4 deletions Tools/scripts/build_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def config_option(self):
Feature('Camera', 'Camera_ThermalRange', 'AP_CAMERA_SEND_THERMAL_RANGE_ENABLED', 'Enable GCS camera thermal range', 0, 'Camera,MOUNT'), # noqa: E501
Feature('Camera', 'Camera_Info_From_Script', 'AP_CAMERA_INFO_FROM_SCRIPT_ENABLED', 'Enable Camera information messages via Lua script', 0, 'Camera,SCRIPTING'), # noqa

Feature('Camera', 'RUNCAM', 'AP_CAMERA_RUNCAM_ENABLED', 'Enable RunCam control', 0, None),
Feature('Camera', 'RUNCAM', 'AP_CAMERA_RUNCAM_ENABLED', 'Enable RunCam control', 0, 'Camera'),

Feature('Copter', 'MODE_ZIGZAG', 'MODE_ZIGZAG_ENABLED', 'Enable Mode ZigZag', 0, None),
Feature('Copter', 'MODE_SYSTEMID', 'MODE_SYSTEMID_ENABLED', 'Enable Mode SystemID', 0, 'Logging'),
Expand Down Expand Up @@ -345,7 +345,7 @@ def config_option(self):
Feature('IMU', 'HarmonicNotches', 'AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED', 'Enable InertialSensor harmonic notch filters', 0, None), # noqa
Feature('IMU', 'BatchSampler', 'AP_INERTIALSENSOR_BATCHSAMPLER_ENABLED', 'Enable Batch sampler', 0, None), # noqa

Feature('Other', 'RateLoopThread', 'AP_INERTIALSENSOR_FAST_SAMPLE_WINDOW_ENABLED', 'Enable Rate Loop Thread', 0, None), # noqa
Feature('Other', 'RateLoopThread', 'AP_INERTIALSENSOR_FAST_SAMPLE_WINDOW_ENABLED', 'Enable Rate Loop Thread', 0, 'HarmonicNotches'), # noqa
Feature('Other', 'GyroFFT', 'HAL_GYROFFT_ENABLED', 'Enable In-Flight gyro FFT calculations', 0, None),
Feature('Other', 'NMEA_OUTPUT', 'HAL_NMEA_OUTPUT_ENABLED', 'Enable NMEA output', 0, None),
Feature('Other', 'SDCARD_FORMATTING', 'AP_FILESYSTEM_FORMAT_ENABLED', 'Enable Formatting of microSD cards', 0, None),
Expand Down Expand Up @@ -432,10 +432,10 @@ def config_option(self):
Feature('Filesystem', 'APJ_TOOL_PARAMETERS', 'FORCE_APJ_DEFAULT_PARAMETERS', 'Enable apj_tool parameter area', 0, None),

Feature('Networking', 'PPP', 'AP_NETWORKING_BACKEND_PPP', 'Enable PPP networking', 0, None),
Feature('Networking', 'CAN MCAST', 'AP_NETWORKING_CAN_MCAST_ENABLED', 'Enable CAN multicast bridge', 0, None),
# Feature('Networking', 'CAN MCAST', 'AP_NETWORKING_CAN_MCAST_ENABLED', 'Enable CAN multicast bridge', 0, None),

Feature('CAN', 'DroneCAN', 'HAL_ENABLE_DRONECAN_DRIVERS', 'Enable DroneCAN support', 0, None),
Feature('CAN', 'CAN Logging', 'AP_CAN_LOGGING_ENABLED', 'Enable CAN logging support', 0, None),
Feature('CAN', 'CAN Logging', 'AP_CAN_LOGGING_ENABLED', 'Enable CAN logging support', 0, 'Logging'),
]

BUILD_OPTIONS.sort(key=lambda x: (x.category + x.label))
Expand Down
1 change: 1 addition & 0 deletions Tools/scripts/extract_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def __init__(self, filename, nm="arm-none-eabi-nm", strings="strings"):

('AP_IBUS_TELEM_ENABLED', 'AP_IBus_Telem::init',),

('MODE_AUTOLAND_ENABLED', 'ModeAutoLand::update'),
('MODE_{type}_ENABLED', r'Mode(?P<type>.+)::init',),
('MODE_GUIDED_NOGPS_ENABLED', r'ModeGuidedNoGPS::init',),

Expand Down
8 changes: 0 additions & 8 deletions libraries/AP_CANManager/AP_CANManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@
#include <AP_Common/sorting.h>
#include <AP_Logger/AP_Logger.h>

/*
avoid a recursion issue with config defines
*/
#if AP_CAN_LOGGING_ENABLED && !HAL_LOGGING_ENABLED
#undef AP_CAN_LOGGING_ENABLED
#define AP_CAN_LOGGING_ENABLED 0
#endif

#define LOG_TAG "CANMGR"
#define LOG_BUFFER_SIZE 1024

Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_CANManager/AP_CANManager_config.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once

#include <AP_HAL/AP_HAL_Boards.h>
#include <AP_Logger/AP_Logger_config.h>

#ifndef AP_CAN_SLCAN_ENABLED
#define AP_CAN_SLCAN_ENABLED HAL_MAX_CAN_PROTOCOL_DRIVERS
#endif

#ifndef AP_CAN_LOGGING_ENABLED
#define AP_CAN_LOGGING_ENABLED HAL_MAX_CAN_PROTOCOL_DRIVERS
#define AP_CAN_LOGGING_ENABLED HAL_MAX_CAN_PROTOCOL_DRIVERS && HAL_LOGGING_ENABLED
#endif

2 changes: 1 addition & 1 deletion libraries/AP_Networking/AP_Networking_CAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ void AP_Networking_CAN::can_frame_callback(uint8_t bus, const AP_HAL::CANFrame &
mcast_sockets[bus]->send((void*)&pkt, data_length+MCAST_HDR_LENGTH);
}

#endif // AP_NETWORKING_ENABLED && AP_NETWORKING_CAN_MCAST_ENABLED
#endif // AP_NETWORKING_ENABLED
Loading