We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06761f1 commit 4d06528Copy full SHA for 4d06528
bms/src/BmsThread.h
@@ -201,11 +201,13 @@ class BMSThread {
201
202
// Send CAN
203
for (size_t i = 0; i < BMS_BANK_COUNT; i++) {
204
+ // Convert from optional temp values to values with default of -127 (to indicate error)
205
auto temps = std::array<int8_t, BMS_BANK_TEMP_COUNT>();
206
std::transform(allTemps.begin() + (BMS_BANK_TEMP_COUNT * i),
207
allTemps.begin() + (BMS_BANK_TEMP_COUNT * (i + 1)),
208
temps.begin(),
209
[](tl::optional<int8_t> t) { return t.value_or(-127); });
210
+
211
canBus->write(BMSTempMessage(i, (uint8_t*)temps.data()));
212
}
213
0 commit comments