4FlexCAN_T4<CAN1, RX_SIZE_256, TX_SIZE_16>
can1;
46extern volatile bool TSOn;
74#define DC_THRESHOLD 4328
219 uint8_t byte1 = (value_bamo >> 8) & 0xFF;
220 uint8_t byte2 = value_bamo & 0xFF;
228 uint8_t byte1 = (val1 >> 8) & 0xFF;
229 uint8_t byte2 = val1 & 0xFF;
230 uint8_t byte3 = (val2 >> 8) & 0xFF;
231 uint8_t byte4 = val2 & 0xFF;
261 switch (
msg.buf[0]) {
268 dc_voltage = (
msg.buf[2] << 8) |
msg.buf[1];
298 Serial.println(
"BTB ready");
306 Serial.println(
"Transmission enabled");
311 if (
msg.buf[0] == 0x31) {
312 if (
msg.buf[1] == 2) {
317 else if (
msg.buf[1] == 5) {
335 can1.setBaudRate(500000);
337 can1.enableFIFOInterrupt();
338 can1.setFIFOFilter(REJECT_ALL);
CAN_message_t transmissionRequestEnable
CAN_message_t battery_voltage
CAN_message_t torqueRequest
void sendAPPS(int val1, int val2)
elapsedMillis ASEmergencyTimer
CAN_message_t enableResponse
CAN_message_t DCVoltageRequest
volatile bool transmissionEnabled
void sendTorqueVal(int value_bamo)
void initCanMessages()
Initialize CAN messages.
void request_dataLOG_messages()
CAN_message_t VoltageMotor
CAN_message_t clearErrors
void REGIDHandler(const CAN_message_t &msg)
volatile uint16_t brakeValue
CAN_message_t actualSpeedRequest
CAN_message_t BTBResponse
CAN_message_t torque_motor
CAN_message_t statusRequest
CAN_message_t currentMOTOR
CAN_message_t speedRequest
void canSniffer(const CAN_message_t &msg)
volatile bool R2DOverride
FlexCAN_T4< CAN1, RX_SIZE_256, TX_SIZE_16 > can1