PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

Add module param header to uavcan sensor bridge instead of battery header only

Open dirksavage88 opened this issue 1 year ago • 1 comments

Solved Problem

When compiling from source and reducing the number of uavcan sensors in kconfig, removing battery would cause compilation to fail: 134 | param_get(param_find("UAVCAN_SUB_FLOW"), &uavcan_sub_flow); | ^~~~~~~~~~

This is due to the uavcan battery header file including the platform common header for the param module. This module should instead be moved to the sensor bridge header

dirksavage88 avatar Feb 21 '24 14:02 dirksavage88

Since UavcanBatteryBridge is currently the only thing using ModuleParams I would keep the include there. IUavcanSensorBridge has nothing to do with ModuleParams (although we could change that).

Can you share the full output? Let's capture the actual dependencies in the right place.

dagar avatar Feb 22 '24 16:02 dagar

Removing battery status from uavcan kconfig subs results in the following error: ource/Firmware/src/drivers/uavcan/sensors/sensor_bridge.cpp:145:12: error: 'param_find' was not declared in this scope 145 | param_get(param_find("UAVCAN_SUB_GPS"), &uavcan_sub_gps); | ^~~~~~~~~~ compilation terminated due to -Wfatal-errors. [625/1212] Building CXX object src/drivers/uavcan/CMakeFiles/drivers__uavcan.dir/uavcan_main.cpp.obj ninja: build stopped: subcommand failed. make: *** [Makefile:227: nxp_fmuk66-v3_default] Error 1

dirksavage88 avatar Mar 13 '24 14:03 dirksavage88