From 2d7653406a268c1258a0534312095dfcd83fa812 Mon Sep 17 00:00:00 2001 From: Balduin Date: Mon, 14 Jul 2025 18:04:13 +0200 Subject: [PATCH] cs_check: const where possible --- .../control_allocator/ControlAllocator.cpp | 8 ++++---- .../control_allocator/ControlAllocator.hpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/modules/control_allocator/ControlAllocator.cpp b/src/modules/control_allocator/ControlAllocator.cpp index c2894dbcc0..aa3360669c 100644 --- a/src/modules/control_allocator/ControlAllocator.cpp +++ b/src/modules/control_allocator/ControlAllocator.cpp @@ -533,8 +533,8 @@ void ControlAllocator::preflight_check_start(vehicle_command_s &cmd, hrt_abstime preflight_check_abort(now); } - int axis = (uint8_t) lroundf(cmd.param1); - float input = cmd.param2; + const int axis = (uint8_t) lroundf(cmd.param1); + const float input = cmd.param2; _preflight_check_running = true; _preflight_check_axis = axis; @@ -624,14 +624,14 @@ void ControlAllocator::preflight_check_overwrite_torque_sp(matrix::VectoroverrideCollectiveTilt(true, modified_tilt_control); diff --git a/src/modules/control_allocator/ControlAllocator.hpp b/src/modules/control_allocator/ControlAllocator.hpp index 45d6256413..668a832d30 100644 --- a/src/modules/control_allocator/ControlAllocator.hpp +++ b/src/modules/control_allocator/ControlAllocator.hpp @@ -147,14 +147,14 @@ private: void publish_actuator_controls(); void preflight_check_overwrite_torque_sp(matrix::Vector (&c)[ActuatorEffectiveness::MAX_NUM_MATRICES], - bool is_vtol); - void preflight_check_handle_command(hrt_abstime now); - void preflight_check_update_state(hrt_abstime now); - void preflight_check_handle_tilt_control(hrt_abstime now); - void preflight_check_start(vehicle_command_s &cmd, hrt_abstime now); - void preflight_check_send_ack(uint8_t result, hrt_abstime now); - void preflight_check_abort(hrt_abstime now); - void preflight_check_finish(hrt_abstime now); + const bool is_vtol); + void preflight_check_handle_command(const hrt_abstime now); + void preflight_check_update_state(const hrt_abstime now); + void preflight_check_handle_tilt_control(const hrt_abstime now); + void preflight_check_start(vehicle_command_s &cmd, const hrt_abstime now); + void preflight_check_send_ack(uint8_t result, const hrt_abstime now); + void preflight_check_abort(const hrt_abstime now); + void preflight_check_finish(const hrt_abstime now); AllocationMethod _allocation_method_id{AllocationMethod::NONE}; ControlAllocation *_control_allocation[ActuatorEffectiveness::MAX_NUM_MATRICES] {}; ///< class for control allocation calculations