microRusEFI used as Body Control Module BCM BCU

This commit is contained in:
rusefi 2020-09-06 22:36:31 -04:00
parent 7d0c8b4870
commit 8296f54923
3 changed files with 14 additions and 8 deletions

View File

@ -204,6 +204,9 @@ void setBoardConfigurationOverrides(void) {
setupTle8888();
setupEtb();
engineConfiguration->canTxPin = GPIOB_6;
engineConfiguration->canRxPin = GPIOB_12;
// MRE has a special main relay control low side pin
// rusEfi firmware is totally not involved with main relay control on microRusEfi board
// todo: maybe even set EFI_MAIN_RELAY_CONTROL to FALSE for MRE configuration

View File

@ -82,11 +82,15 @@ private:
template <typename TStorage, int TScale>
class ObdCanSensor: public CanSensorBase {
public:
ObdCanSensor(uint32_t eid, SensorType type, efitick_t timeout) :
ObdCanSensor(uint32_t eid, int PID, SensorType type, efitick_t timeout) :
CanSensorBase(eid, type, timeout) {
this->PID = PID;
}
void decodeFrame(const CANRxFrame& frame, efitick_t nowNt) override {
if (frame.data8[2] != PID) {
return;
}
// Compute the location of our data within the frame
const uint8_t* dataLocation = &frame.data8[0];
@ -108,5 +112,7 @@ public:
}
return m_next;
}
int PID;
};

View File

@ -23,24 +23,21 @@ CanSensor<int16_t, PACK_MULT_PERCENT> canPedalSensor(
);
ObdCanSensor<int16_t, ODB_RPM_MULT> obdRpmSensor(
PID_RPM,
OBD_TEST_RESPONSE, PID_RPM,
SensorType::Rpm, TIMEOUT
);
ObdCanSensor<int16_t, 1> obdCltSensor(
PID_COOLANT_TEMP,
OBD_TEST_RESPONSE, PID_COOLANT_TEMP,
SensorType::Clt, TIMEOUT
);
void initCanSensors() {
#if EFI_CANBUS_SLAVE
registerCanSensor(canPedalSensor);
if (CONFIG(consumeObdSensors)) {
// registerCanSensor(canPedalSensor);
registerCanSensor(obdRpmSensor);
registerCanSensor(obdCltSensor);
// registerCanSensor(obdCltSensor);
}
#endif // EFI_CANBUS_SLAVE
}
#endif // EFI_CAN_SUPPORT