fome-fw/firmware/config/engines/bmw_e34.cpp

87 lines
2.6 KiB
C++
Raw Normal View History

2014-11-05 12:03:26 -08:00
/**
* @file bmw_e34.cpp
*
* set_engine_type 25
*
2014-11-05 14:03:24 -08:00
* Coil pairs: 1-6, 2-5, 3-4
*
* Injector groups: 1,2,3 <EFBFBD> 4,5,6
*
2014-11-05 12:03:26 -08:00
* @date Nov 5, 2014
2015-01-12 15:04:10 -08:00
* @author Andrey Belomutskiy, (c) 2012-2015
2014-11-05 12:03:26 -08:00
*/
#include "global.h"
#include "bmw_e34.h"
2014-11-14 14:03:57 -08:00
void setBmwE34(engine_configuration_s *engineConfiguration) {
2014-11-05 12:03:26 -08:00
engineConfiguration->rpmHardLimit = 6000;
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
2015-01-23 09:04:28 -08:00
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
2015-02-09 08:07:00 -08:00
engineConfiguration->specs.cylindersCount = 6;
engineConfiguration->specs.firingOrder = FO_1_THEN_5_THEN_3_THEN_6_THEN_2_THEN_4;
2014-11-05 15:03:02 -08:00
engineConfiguration->injectionMode = IM_SIMULTANEOUS;
2014-11-05 14:03:24 -08:00
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
2014-11-05 12:03:26 -08:00
2014-11-25 18:03:18 -08:00
engineConfiguration->ignMathCalculateAtIndex = 15;
2014-11-06 07:06:08 -08:00
setConstantDwell(engineConfiguration, 3); // a bit shorter dwell
engineConfiguration->useConstantDwellDuringCranking = true;
engineConfiguration->ignitionDwellForCrankingMs = 5;
2014-11-05 19:03:10 -08:00
// todo: check the digital sniffer while simulating
// set_global_trigger_offset_angle 84
engineConfiguration->globalTriggerAngleOffset = 84;
setWholeFuelMap(engineConfiguration, 6);
setWholeTimingTable(engineConfiguration, 10);
2014-11-05 15:03:02 -08:00
board_configuration_s *bc = &engineConfiguration->bc;
2014-11-10 07:03:20 -08:00
bc->malfunctionIndicatorPin = GPIO_UNASSIGNED;
2014-11-05 15:03:02 -08:00
2014-11-08 19:03:27 -08:00
// bc->isFastAdcEnabled = true;
2014-11-13 11:03:15 -08:00
bc->ignitionPinMode = OM_INVERTED;
2014-11-05 15:03:02 -08:00
bc->ignitionPins[0] = GPIOC_7; // #1
2014-11-10 07:03:20 -08:00
bc->ignitionPins[1] = GPIO_UNASSIGNED; // #2
2014-11-05 15:03:02 -08:00
bc->ignitionPins[2] = GPIOE_4; // #3
2014-11-10 07:03:20 -08:00
bc->ignitionPins[3] = GPIO_UNASSIGNED; // #4
2014-11-05 15:03:02 -08:00
bc->ignitionPins[4] = GPIOC_9; // #5
2014-11-10 07:03:20 -08:00
bc->ignitionPins[5] = GPIO_UNASSIGNED; // #6
2014-11-05 15:03:02 -08:00
2014-11-13 11:03:15 -08:00
bc->injectionPinMode = OM_INVERTED;
2014-11-22 15:04:49 -08:00
bc->injectionPins[0] = GPIOB_9; // #1
bc->injectionPins[1] = GPIOB_8; // #2
/**
* this is a relatively dirty performance hack: with unassigned pin we
* have less stuff to put into wave chart
*/
bc->injectionPins[2] = GPIO_UNASSIGNED; // #3
bc->injectionPins[3] = GPIO_UNASSIGNED; // #4
bc->injectionPins[4] = GPIO_UNASSIGNED; // #5
bc->injectionPins[5] = GPIO_UNASSIGNED; // #6
2014-11-23 11:04:18 -08:00
bc->triggerErrorPin = GPIOE_3;
2014-11-22 15:04:49 -08:00
/**
* emulating the 60-0 trigger takes some resources, let's keep it slow by default
* rpm 200
*/
2014-11-10 12:03:16 -08:00
bc->triggerSimulatorFrequency = 200;
2015-01-22 17:05:54 -08:00
engineConfiguration->map.sensor.type = MT_MPX4250;
2014-11-14 16:03:12 -08:00
engineConfiguration->hasCltSensor = false;
engineConfiguration->hasIatSensor = false;
2014-11-17 19:03:46 -08:00
/**
* This saves a couple of ticks in trigger emulation methods
2014-11-17 20:03:43 -08:00
* TODO: add some smart logic to detect unneeded trigger simulation pins?
* TODO: but probably not worth it
2014-11-17 19:03:46 -08:00
*/
2014-11-17 20:03:43 -08:00
bc->triggerSimulatorPins[1] = GPIO_UNASSIGNED;
bc->triggerSimulatorPins[2] = GPIO_UNASSIGNED;
2014-11-05 12:03:26 -08:00
}