camera_capture: refactor to simplify capture channel initialization

This commit is contained in:
Matthias Grob
2024-12-19 07:30:25 +01:00
parent 267fa06da8
commit 8ce6ad6662
2 changed files with 1 additions and 4 deletions
@@ -71,9 +71,6 @@ CameraCapture::CameraCapture() :
_p_camera_capture_edge = param_find("CAM_CAP_EDGE"); _p_camera_capture_edge = param_find("CAM_CAP_EDGE");
param_get(_p_camera_capture_edge, &_camera_capture_edge); param_get(_p_camera_capture_edge, &_camera_capture_edge);
// get the capture channel from function configuration params
_capture_channel = -1;
for (unsigned i = 0; i < 16 && _capture_channel == -1; ++i) { for (unsigned i = 0; i < 16 && _capture_channel == -1; ++i) {
char param_name[17]; char param_name[17];
snprintf(param_name, sizeof(param_name), "%s_%s%d", PARAM_PREFIX, "FUNC", i + 1); snprintf(param_name, sizeof(param_name), "%s_%s%d", PARAM_PREFIX, "FUNC", i + 1);
@@ -96,7 +96,7 @@ public:
static struct work_s _work_publisher; static struct work_s _work_publisher;
private: private:
int _capture_channel = 5; ///< by default, use FMU output 6 int _capture_channel{-1};
// Publishers // Publishers
uORB::Publication<vehicle_command_ack_s> _command_ack_pub{ORB_ID(vehicle_command_ack)}; uORB::Publication<vehicle_command_ack_s> _command_ack_pub{ORB_ID(vehicle_command_ack)};