microRusEFI used as Body Control Module BCM BCU

This commit is contained in:
rusefi 2020-09-06 20:21:01 -04:00
parent 52cb30f9ea
commit 39d09bc976
3 changed files with 9 additions and 17 deletions

View File

@ -102,18 +102,13 @@ void setEngineBMW_M73_microRusEfi(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->canNbcType = CAN_BUS_NBC_NONE;
#if EFI_CANBUS_SLAVE
engineConfiguration->canReadEnabled = true;
engineConfiguration->canWriteEnabled = false;
#else /* EFI_CANBUS_SLAVE */
// set_analog_input_pin pps PA7
// EFI_ADC_7: "31 - AN volt 3" - PA7
CONFIG(throttlePedalPositionAdcChannel) = EFI_ADC_7;
engineConfiguration->canReadEnabled = false;
engineConfiguration->canReadEnabled = true;
engineConfiguration->canWriteEnabled = true;
CONFIG(enableVerboseCanTx) = true;
#endif /* EFI_CANBUS_SLAVE */
// do I have VR wires flipped?

View File

@ -117,17 +117,12 @@ private:
static CanRead canRead;
static CanWrite canWrite;
static void canInfo(void) {
if (!isCanEnabled) {
scheduleMsg(&logger, "CAN is not enabled, please enable & restart");
return;
}
#if EFI_CANBUS_SLAVE
scheduleMsg(&logger, "CAN SLAVE MODE");
#endif
scheduleMsg(&logger, "CAN TX %s", hwPortname(CONFIG_OVERRIDE(canTxPin)));
scheduleMsg(&logger, "CAN RX %s", hwPortname(CONFIG_OVERRIDE(canRxPin)));
scheduleMsg(&logger, "type=%d canReadEnabled=%s canWriteEnabled=%s period=%d", engineConfiguration->canNbcType,

View File

@ -75,12 +75,14 @@ void initTps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
float min = CONFIG(tpsErrorDetectionTooLow);
float max = CONFIG(tpsErrorDetectionTooHigh);
initTpsFunc(tpsFunc1p, tpsSens1p, CONFIG(tps1_1AdcChannel), CONFIG(tpsMin), CONFIG(tpsMax), min, max);
initTpsFuncAndRedund(tps1, tpsFunc1s, tpsSens1s, CONFIG(tps1_2AdcChannel), CONFIG(tps1SecondaryMin), CONFIG(tps1SecondaryMax), min, max);
initTpsFunc(tpsFunc2p, tpsSens2p, CONFIG(tps2_1AdcChannel), CONFIG(tps2Min), CONFIG(tps2Max), min, max);
initTpsFuncAndRedund(tps2, tpsFunc2s, tpsSens2s, CONFIG(tps2_2AdcChannel), CONFIG(tps2SecondaryMin), CONFIG(tps2SecondaryMax), min, max);
initTpsFunc(pedalFuncPrimary, pedalSensorPrimary, CONFIG(throttlePedalPositionAdcChannel), CONFIG(throttlePedalUpVoltage), CONFIG(throttlePedalWOTVoltage), min, max);
initTpsFuncAndRedund(pedal, pedalFuncSecondary, pedalSensorSecondary, CONFIG(throttlePedalPositionSecondAdcChannel), CONFIG(throttlePedalSecondaryUpVoltage), CONFIG(throttlePedalSecondaryWOTVoltage), min, max);
if (!CONFIG(consumeObdSensors)) {
initTpsFunc(tpsFunc1p, tpsSens1p, CONFIG(tps1_1AdcChannel), CONFIG(tpsMin), CONFIG(tpsMax), min, max);
initTpsFuncAndRedund(tps1, tpsFunc1s, tpsSens1s, CONFIG(tps1_2AdcChannel), CONFIG(tps1SecondaryMin), CONFIG(tps1SecondaryMax), min, max);
initTpsFunc(tpsFunc2p, tpsSens2p, CONFIG(tps2_1AdcChannel), CONFIG(tps2Min), CONFIG(tps2Max), min, max);
initTpsFuncAndRedund(tps2, tpsFunc2s, tpsSens2s, CONFIG(tps2_2AdcChannel), CONFIG(tps2SecondaryMin), CONFIG(tps2SecondaryMax), min, max);
initTpsFunc(pedalFuncPrimary, pedalSensorPrimary, CONFIG(throttlePedalPositionAdcChannel), CONFIG(throttlePedalUpVoltage), CONFIG(throttlePedalWOTVoltage), min, max);
initTpsFuncAndRedund(pedal, pedalFuncSecondary, pedalSensorSecondary, CONFIG(throttlePedalPositionSecondAdcChannel), CONFIG(throttlePedalSecondaryUpVoltage), CONFIG(throttlePedalSecondaryWOTVoltage), min, max);
}
// Route the pedal or TPS to driverIntent as appropriate
if (CONFIG(throttlePedalPositionAdcChannel) != EFI_ADC_NONE) {