Skip to content

Commit

Permalink
Allow scaleValue() for 32bit values
Browse files Browse the repository at this point in the history
  • Loading branch information
ranma committed Sep 14, 2024
1 parent a6e7007 commit 55a498f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/BatteryCanReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class BatteryCanReceiver : public BatteryProvider {
uint16_t readUnsignedInt16(uint8_t *data);
int16_t readSignedInt16(uint8_t *data);
uint32_t readUnsignedInt32(uint8_t *data);
float scaleValue(int16_t value, float factor);
float scaleValue(int32_t value, float factor);
bool getBit(uint8_t value, uint8_t bit);

bool _verboseLogging = true;
Expand Down
2 changes: 1 addition & 1 deletion src/BatteryCanReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ uint32_t BatteryCanReceiver::readUnsignedInt32(uint8_t *data)
return (data[3] << 24) | (data[2] << 16) | (data[1] << 8) | data[0];
}

float BatteryCanReceiver::scaleValue(int16_t value, float factor)
float BatteryCanReceiver::scaleValue(int32_t value, float factor)
{
return value * factor;
}
Expand Down

0 comments on commit 55a498f

Please sign in to comment.