From e2c75122ee626052f54b534423bbb9273d90398f Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Sat, 29 Jun 2024 18:23:50 -0500 Subject: [PATCH] :recycle: Use east const --- .clang-format | 1 + include/libhal-icm/icm20948.hpp | 4 ++-- src/icm20948.cpp | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.clang-format b/.clang-format index b72f919..c9c00d1 100644 --- a/.clang-format +++ b/.clang-format @@ -7,3 +7,4 @@ AllowShortFunctionsOnASingleLine: None FixNamespaceComments: true SpacesBeforeTrailingComments: 2 ColumnLimit: 80 +QualifierAlignment: Right diff --git a/include/libhal-icm/icm20948.hpp b/include/libhal-icm/icm20948.hpp index 74ed46d..d8bea85 100644 --- a/include/libhal-icm/icm20948.hpp +++ b/include/libhal-icm/icm20948.hpp @@ -229,14 +229,14 @@ class icm20948 * @param acc_offsets Acceleration offset struct. */ hal::status set_acceleration_offsets( - const acceleration_offset_t& acc_offsets); + acceleration_offset_t const& acc_offsets); /** * @brief Set default gyroscope offsets * All offset parameters are in degrees/second * @param gyro_offsets Gyro offset struct. */ - hal::status set_gyro_offsets(const gyro_offset_t& gyro_offsets); + hal::status set_gyro_offsets(gyro_offset_t const& gyro_offsets); /** * @brief Read & return whoami register value diff --git a/src/icm20948.cpp b/src/icm20948.cpp index 1a6fd71..87493cd 100644 --- a/src/icm20948.cpp +++ b/src/icm20948.cpp @@ -73,7 +73,7 @@ hal::status icm20948::auto_offsets() } hal::status icm20948::set_acceleration_offsets( - const acceleration_offset_t& acc_offsets) + acceleration_offset_t const& acc_offsets) { m_acc_offset_val.x = (acc_offsets.xmax + acc_offsets.xmin) * 0.5; m_acc_offset_val.y = (acc_offsets.ymax + acc_offsets.ymin) * 0.5; @@ -85,7 +85,7 @@ hal::status icm20948::set_acceleration_offsets( return hal::success(); } -hal::status icm20948::set_gyro_offsets(const gyro_offset_t& gyr_offsets) +hal::status icm20948::set_gyro_offsets(gyro_offset_t const& gyr_offsets) { m_gyro_offset_val.x = gyr_offsets.x_offset; m_gyro_offset_val.y = gyr_offsets.y_offset; @@ -263,7 +263,7 @@ hal::result icm20948::read_magnetometer() mag_read_t mag_read; int polling_attempts = 0; - const int max_polling_attempts = 1000; + int const max_polling_attempts = 1000; while (true) { auto status = HAL_CHECK(