This commit is contained in:
Matthew Kennedy 2020-12-12 02:09:01 -08:00
parent dfd7781cef
commit fc01d42ddc
1 changed files with 9 additions and 3 deletions

View File

@ -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, 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); static THD_WORKING_AREA(waCanTxThread, 256);
void CanTxThread(void*) void CanTxThread(void*)
{ {
@ -20,8 +26,8 @@ void CanTxThread(void*)
float esr = GetSensorInternalResistance(); float esr = GetSensorInternalResistance();
float lambda = GetLambda(); float lambda = GetLambda();
SendCanData(lambda, esr); //SendCanData(lambda, esr);
SendEmulatedAemXseries(lambda, 0); SendEmulatedAemXseries(lambda, 1);
chThdSleepMilliseconds(10); chThdSleepMilliseconds(10);
} }
@ -29,7 +35,7 @@ void CanTxThread(void*)
void InitCan() void InitCan()
{ {
canStart(&CAND1, &canConfig500); canStart(&CAND1, &canConfig1000);
chThdCreateStatic(waCanTxThread, sizeof(waCanTxThread), NORMALPRIO, CanTxThread, nullptr); chThdCreateStatic(waCanTxThread, sizeof(waCanTxThread), NORMALPRIO, CanTxThread, nullptr);
} }