From dbbb278320f8df297bbc61f34fdca3a9c76e9afb Mon Sep 17 00:00:00 2001 From: xeonqq Date: Fri, 28 Jul 2023 12:33:44 +0200 Subject: [PATCH] Adapt coding style --- Sming/Libraries/MPU6050/README.md | 8 +++----- samples/Accel_Gyro_MPU6050/app/application.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Sming/Libraries/MPU6050/README.md b/Sming/Libraries/MPU6050/README.md index 19ff23e2ab..45243771e6 100644 --- a/Sming/Libraries/MPU6050/README.md +++ b/Sming/Libraries/MPU6050/README.md @@ -2,8 +2,6 @@ Based on code from [jrowberg/i2cdevlib](https://github.com/jrowberg/i2cdevlib/tree/master/ESP32_ESP-IDF/components/MPU6050). Most of the code is the same, except: -- Removed MPU6050::ReadRegister function due to incompatibility. It is also not used anywhere in the original code. -- Removed map function in favor of the Sming built-in one. -- Adapted include path and applied clangformat - - +- Removed MPU6050::ReadRegister function due to incompatibility. It is also not used anywhere in the original code. +- Removed map function in favor of the Sming built-in one. +- Adapted include path and applied clangformat diff --git a/samples/Accel_Gyro_MPU6050/app/application.cpp b/samples/Accel_Gyro_MPU6050/app/application.cpp index d49c231127..1506994989 100644 --- a/samples/Accel_Gyro_MPU6050/app/application.cpp +++ b/samples/Accel_Gyro_MPU6050/app/application.cpp @@ -1,11 +1,11 @@ #include #include -constexpr float main_loop_interval = 0.02; // sec -SimpleTimer main_loop_timer; +constexpr float mainLoopInterval = 0.02; // sec +SimpleTimer mainLoopTimer; MPU6050 mpu; -void print_accel_gyro(int16_t ax, int16_t ay, int16_t az, int16_t gx, int16_t gy, int16_t gz) +void printAccelGyro(int16_t ax, int16_t ay, int16_t az, int16_t gx, int16_t gy, int16_t gz) { Serial.print("a/g:\t"); Serial.print(ax); @@ -21,12 +21,12 @@ void print_accel_gyro(int16_t ax, int16_t ay, int16_t az, int16_t gx, int16_t gy Serial.println(gz); } -void main_loop() +void mainLoop() { int16_t ax, ay, az; int16_t gx, gy, gz; mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); - print_accel_gyro(ax, ay, az, gx, gy, gz); + printAccelGyro(ax, ay, az, gx, gy, gz); } void init() @@ -38,5 +38,5 @@ void init() mpu.initialize(); Serial.println(mpu.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed"); - main_loop_timer.initializeMs(static_cast(main_loop_interval * 1000), main_loop).start(); + mainLoopTimer.initializeMs(static_cast(mainLoopInterval * 1000), mainLoop).start(); }