mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 02:39:57 +02:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
0f647978fa
commit
b349482f20
1 changed files with 8 additions and 8 deletions
|
@ -136,14 +136,14 @@ uint16_t estimateSOCstandard(uint16_t packVoltage) { // Linear interpolation fu
|
||||||
return 0; // Default return for safety, should never reach here
|
return 0; // Default return for safety, should never reach here
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t compute441Checksum(const uint8_t* u8) // Computes the 441 checksum byte
|
uint8_t compute441Checksum(const uint8_t* u8) // Computes the 441 checksum byte
|
||||||
{
|
{
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for (int i = 0; i < 7; ++i) {
|
for (int i = 0; i < 7; ++i) {
|
||||||
sum += u8[i];
|
sum += u8[i];
|
||||||
}
|
}
|
||||||
uint8_t lsb = static_cast<uint8_t>(sum & 0xFF);
|
uint8_t lsb = static_cast<uint8_t>(sum & 0xFF);
|
||||||
return static_cast<uint8_t>(~lsb & 0xFF);
|
return static_cast<uint8_t>(~lsb & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BydAttoBattery::
|
void BydAttoBattery::
|
||||||
|
@ -542,7 +542,7 @@ void BydAttoBattery::transmit_can(unsigned long currentMillis) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (counter_100ms > 3) {
|
if (counter_100ms > 3) {
|
||||||
if (battery_voltage > 0){
|
if (battery_voltage > 0) {
|
||||||
ATTO_3_441.data.u8[4] = (uint8_t)(battery_voltage - 1);
|
ATTO_3_441.data.u8[4] = (uint8_t)(battery_voltage - 1);
|
||||||
ATTO_3_441.data.u8[5] = ((battery_voltage - 1) >> 8);
|
ATTO_3_441.data.u8[5] = ((battery_voltage - 1) >> 8);
|
||||||
ATTO_3_441.data.u8[6] = 0xFF;
|
ATTO_3_441.data.u8[6] = 0xFF;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue