auto-sync
This commit is contained in:
parent
d2ae5b0372
commit
9d856fd770
|
@ -194,6 +194,8 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
|
|||
|
||||
engineConfiguration->tpsMin = convertVoltageTo10bitADC(1.250);
|
||||
engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);
|
||||
engineConfiguration->tpsErrorLowValue = convertVoltageTo10bitADC(0.2);
|
||||
engineConfiguration->tpsErrorHighValue = convertVoltageTo10bitADC(6);
|
||||
|
||||
engineConfiguration->can_nbc_type = CAN_BUS_NBC_BMW;
|
||||
engineConfiguration->can_sleep_period = 50;
|
||||
|
|
|
@ -450,7 +450,10 @@ typedef struct {
|
|||
*/
|
||||
int engineCycle;
|
||||
|
||||
int unused3[5];
|
||||
short int tpsErrorLowValue;
|
||||
short int tpsErrorHighValue;
|
||||
|
||||
int unused3[4];
|
||||
|
||||
} engine_configuration_s;
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ static int getNumberOfInjections(engine_configuration_s const *engineConfigurati
|
|||
float getFuelMs(int rpm, Engine *engine) {
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
float theoreticalInjectionLength;
|
||||
if (isCranking()) {
|
||||
if (isCrankingR(rpm)) {
|
||||
theoreticalInjectionLength = getCrankingFuel(engine) / getNumberOfInjections(engineConfiguration, engineConfiguration->crankingInjectionMode);
|
||||
} else {
|
||||
float baseFuel = getBaseFuel(engine, rpm);
|
||||
|
|
|
@ -55,8 +55,8 @@ extern engine_configuration_s *engineConfiguration;
|
|||
|
||||
int waveChartUsedSize;
|
||||
|
||||
static int isChartActive = TRUE;
|
||||
//static int isChartActive = FALSE;
|
||||
static int isChartActive = true;
|
||||
//static int isChartActive = false;
|
||||
|
||||
//#define DEBUG_WAVE 1
|
||||
|
||||
|
@ -141,6 +141,10 @@ static char timeBuffer[10];
|
|||
* @brief Register an event for digital sniffer
|
||||
*/
|
||||
void WaveChart::addWaveChartEvent3(const char *name, const char * msg, const char * msg2) {
|
||||
if(!isChartActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
efiAssertVoid(isInitialized, "chart not initialized");
|
||||
#if DEBUG_WAVE
|
||||
scheduleSimpleMsg(&debugLogging, "current", chart->counter);
|
||||
|
|
|
@ -94,8 +94,9 @@ static msg_t csThread(void) {
|
|||
chRegSetThreadName("status");
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
while (TRUE) {
|
||||
int is_cranking = isCranking();
|
||||
int is_running = getRpm() > 0 && !is_cranking;
|
||||
int rpm = getRpm();
|
||||
int is_cranking = isCrankingR(rpm);
|
||||
int is_running = rpm > 0 && !is_cranking;
|
||||
if (is_running) {
|
||||
// blinking while running
|
||||
setOutputPinValue(LED_RUNNING, 0);
|
||||
|
|
|
@ -101,12 +101,13 @@ static void handleFuel(Engine *engine, MainTriggerCallback *mainTriggerCallback,
|
|||
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#3");
|
||||
efiAssertVoid(eventIndex < mainTriggerCallback->engineConfiguration2->triggerShape.getLength(), "event index");
|
||||
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
/**
|
||||
* Ignition events are defined by addFuelEvents() according to selected
|
||||
* fueling strategy
|
||||
*/
|
||||
ActuatorEventList *source =
|
||||
isCranking() ?
|
||||
isCrankingR(rpm) ?
|
||||
&mainTriggerCallback->engineConfiguration2->engineEventConfiguration.crankingInjectionEvents :
|
||||
&mainTriggerCallback->engineConfiguration2->engineEventConfiguration.injectionEvents;
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ extern WaveChart waveChart;
|
|||
#define TOP_DEAD_CENTER_MESSAGE "r"
|
||||
|
||||
/**
|
||||
* WARNING: this is a heavy method because 'getRpm()' is relatively heavy
|
||||
*
|
||||
* @return -1 in case of isNoisySignal(), current RPM otherwise
|
||||
*/
|
||||
int getRpmE(Engine *engine) {
|
||||
|
@ -83,6 +85,9 @@ bool isValidRpm(int rpm) {
|
|||
}
|
||||
|
||||
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
|
||||
/**
|
||||
* WARNING: this is a heavy method because 'getRpm()' is relatively heavy
|
||||
*/
|
||||
bool isCranking(void) {
|
||||
int rpm = getRpm();
|
||||
return isCrankingR(rpm);
|
||||
|
|
Loading…
Reference in New Issue