Skip to content

Add mbed header and fix undefined behavior in can header #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bms/src/Can.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <stdint.h>

#include "mbed.h"

// SIDs From Accumulator
constexpr uint32_t kFuncIdHeartBeatAcc = 0x701;
constexpr uint32_t kFuncIdCellStartup = 0x420;
Expand Down Expand Up @@ -48,7 +50,7 @@ CANMessage BMSVoltageMessage (uint8_t row, uint16_t * voltages) {
uint8_t data[8];
for (int i = 0; i < 8; i += 2) {
data[i] = voltages[i/2] >> 8;
data[++i] = voltages [i/2];
data[i + 1] = voltages [i/2];
}
return CANMessage(kFuncIdCellVoltage[row], data);
}
Expand Down