2016-01-21 15:03:40 -08:00
|
|
|
/*
|
|
|
|
* @file lada_kalina.cpp
|
|
|
|
*
|
2017-01-06 07:04:41 -08:00
|
|
|
* set engine_type 39
|
2016-01-21 15:03:40 -08:00
|
|
|
*
|
|
|
|
* @date Jan 21, 2016
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2016-01-21 15:03:40 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "lada_kalina.h"
|
2016-03-21 13:01:49 -07:00
|
|
|
#include "custom_engine.h"
|
|
|
|
#include "fsio_impl.h"
|
|
|
|
|
2019-05-03 15:41:43 -07:00
|
|
|
EXTERN_CONFIG;
|
2016-01-21 15:03:40 -08:00
|
|
|
|
2019-05-03 15:41:43 -07:00
|
|
|
void setLadaKalina(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2019-08-06 14:12:15 -07:00
|
|
|
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2019-12-11 14:48:55 -08:00
|
|
|
disableLCD(engineConfiguration);
|
2016-03-21 13:01:49 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->HD44780_rs = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->HD44780_e = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->HD44780_db4 = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->HD44780_db5 = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->HD44780_db6 = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->HD44780_db7 = GPIO_UNASSIGNED;
|
2016-03-22 12:02:03 -07:00
|
|
|
|
|
|
|
|
2016-03-21 13:01:49 -07:00
|
|
|
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
2016-03-22 11:03:44 -07:00
|
|
|
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->triggerInputPins[0] = GPIOA_5;
|
|
|
|
engineConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;
|
2016-03-22 11:03:44 -07:00
|
|
|
|
|
|
|
engineConfiguration->globalTriggerAngleOffset = 114;
|
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->ignitionPins[0] = GPIOE_14;
|
|
|
|
engineConfiguration->ignitionPins[1] = GPIOC_7;
|
|
|
|
engineConfiguration->ignitionPins[2] = GPIOC_9;
|
|
|
|
engineConfiguration->ignitionPins[3] = GPIOE_12;
|
2016-03-22 11:03:44 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->useStepperIdle = true;
|
|
|
|
engineConfiguration->fuelPumpPin = GPIOC_13;
|
|
|
|
engineConfiguration->mainRelayPin = GPIOD_7;
|
2016-03-22 11:03:44 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->idle.stepperDirectionPin = GPIOE_15;
|
|
|
|
engineConfiguration->idle.stepperStepPin = GPIOE_13;
|
2016-03-22 11:03:44 -07:00
|
|
|
engineConfiguration->stepperEnablePin = GPIOE_11;
|
|
|
|
|
2016-03-21 13:01:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
// starter relay solenoid
|
2019-04-12 19:10:57 -07:00
|
|
|
#if EFI_FSIO
|
2016-03-21 13:01:49 -07:00
|
|
|
/**
|
|
|
|
* to test
|
2017-03-12 11:47:21 -07:00
|
|
|
* set_fsio_setting 1 5000
|
2016-03-21 13:01:49 -07:00
|
|
|
*/
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->fsio_setting[0] = 500;
|
2017-03-08 21:05:52 -08:00
|
|
|
// set_rpn_expression 1 "rpm 0 fsio_setting <"
|
2019-05-03 15:41:43 -07:00
|
|
|
setFsioExt(0, GPIOE_3, RPM_BELOW_USER_SETTING_1, 0 PASS_CONFIG_PARAMETER_SUFFIX);
|
2019-03-29 07:46:16 -07:00
|
|
|
#endif /* EFI_FSIO */
|
2016-01-21 15:03:40 -08:00
|
|
|
}
|