Skip to content

Commit

Permalink
Use a better function name
Browse files Browse the repository at this point in the history
  • Loading branch information
everevian committed Oct 24, 2022
1 parent a5394de commit a7e5057
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/drivers/Nobra.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...);

Expand Down
4 changes: 2 additions & 2 deletions src/drivers/Nobra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit a7e5057

Please sign in to comment.