From a7e5057f76cd4744968a3d4fcbd6c54dca93922c Mon Sep 17 00:00:00 2001 From: everevian Date: Mon, 24 Oct 2022 03:20:26 -0500 Subject: [PATCH] Use a better function name --- include/drivers/Nobra.h | 2 +- src/drivers/Nobra.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/drivers/Nobra.h b/include/drivers/Nobra.h index 8207d39a..d7c21585 100644 --- a/include/drivers/Nobra.h +++ b/include/drivers/Nobra.h @@ -16,7 +16,7 @@ namespace BluetoothDriver { bool setSpeed(uint8_t speed) override; protected: - char getSpeed(uint8_t speed); + char mapSpeed(uint8_t speed); bool send(const char *cmd); bool sendf(const char *fmt, ...); diff --git a/src/drivers/Nobra.cpp b/src/drivers/Nobra.cpp index aab9a3f6..67d3c213 100644 --- a/src/drivers/Nobra.cpp +++ b/src/drivers/Nobra.cpp @@ -5,7 +5,7 @@ using namespace BluetoothDriver; static const char* TAG = "BluetoothDriver::Nobra"; -char Nobra::getSpeed(uint8_t speed) { +char Nobra::mapSpeed(uint8_t speed) { const uint8_t nobraSpeedResolution = 15; float proportion = float(speed) / 255.0; uint8_t nobraSpeed = round(nobraSpeedResolution * proportion); @@ -17,7 +17,7 @@ char Nobra::getSpeed(uint8_t speed) { } bool Nobra::setSpeed(uint8_t speed) { - char speedCommand = getSpeed(speed); + char speedCommand = mapSpeed(speed); bool isShiftingGears = lastSentSpeed != speedCommand; if (!isShiftingGears) {