From fc01d42ddc65846719fc7ba82b6a40aec13e2dfb Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sat, 12 Dec 2020 02:09:01 -0800 Subject: [PATCH] 1 mbit --- firmware/can.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/firmware/can.cpp b/firmware/can.cpp index ed9bed0..718a0dc 100644 --- a/firmware/can.cpp +++ b/firmware/can.cpp @@ -12,6 +12,12 @@ static const CANConfig canConfig500 = CAN_BTR_SJW(0) | CAN_BTR_BRP(5) | CAN_BTR_TS1(12) | CAN_BTR_TS2(1) | CAN_BTR_LBKM, }; +static const CANConfig canConfig1000 = +{ + CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP | CAN_MCR_NART, + CAN_BTR_SJW(0) | CAN_BTR_BRP(2) | CAN_BTR_TS1(12) | CAN_BTR_TS2(1) | CAN_BTR_LBKM, +}; + static THD_WORKING_AREA(waCanTxThread, 256); void CanTxThread(void*) { @@ -20,8 +26,8 @@ void CanTxThread(void*) float esr = GetSensorInternalResistance(); float lambda = GetLambda(); - SendCanData(lambda, esr); - SendEmulatedAemXseries(lambda, 0); + //SendCanData(lambda, esr); + SendEmulatedAemXseries(lambda, 1); chThdSleepMilliseconds(10); } @@ -29,7 +35,7 @@ void CanTxThread(void*) void InitCan() { - canStart(&CAND1, &canConfig500); + canStart(&CAND1, &canConfig1000); chThdCreateStatic(waCanTxThread, sizeof(waCanTxThread), NORMALPRIO, CanTxThread, nullptr); }