2016-04-16 15:01:43 -07:00
|
|
|
/*
|
|
|
|
* @file mazda_miata_1_6.cpp
|
|
|
|
*
|
2016-05-01 07:10:49 -07:00
|
|
|
* Frankenso board
|
2016-04-18 20:01:43 -07:00
|
|
|
* set_engine_type 41
|
|
|
|
*
|
2016-04-16 15:01:43 -07:00
|
|
|
* @date Apr 16, 2016
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2016
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "engine_template.h"
|
|
|
|
#include "custom_engine.h"
|
2016-04-18 20:01:43 -07:00
|
|
|
#include "fsio_impl.h"
|
2016-05-01 07:10:49 -07:00
|
|
|
#include "thermistors.h"
|
2016-04-16 15:01:43 -07:00
|
|
|
|
|
|
|
EXTERN_ENGINE;
|
|
|
|
|
|
|
|
void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) {
|
|
|
|
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
|
|
|
|
2016-04-18 20:01:43 -07:00
|
|
|
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA;
|
2016-04-16 15:01:43 -07:00
|
|
|
|
|
|
|
engineConfiguration->specs.cylindersCount = 4;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_THEN_3_THEN_4_THEN2;
|
|
|
|
|
2016-04-18 20:01:43 -07:00
|
|
|
engineConfiguration->vbattDividerCoeff = 9.75;// ((float) (8.2 + 33)) / 8.2 * 2;
|
|
|
|
|
2016-05-01 07:10:49 -07:00
|
|
|
boardConfiguration->idle.solenoidFrequency = 160;
|
2016-04-19 17:03:53 -07:00
|
|
|
boardConfiguration->idle.solenoidPin = GPIO_UNASSIGNED;
|
2016-04-18 20:01:43 -07:00
|
|
|
|
2016-05-01 07:10:49 -07:00
|
|
|
setCommonNTCSensor(&engineConfiguration->clt);
|
|
|
|
engineConfiguration->clt.config.bias_resistor = 2700;
|
|
|
|
setCommonNTCSensor(&engineConfiguration->iat);
|
|
|
|
engineConfiguration->iat.config.bias_resistor = 2700;
|
|
|
|
|
2016-05-05 18:01:41 -07:00
|
|
|
boardConfiguration->isSdCardEnabled = true;
|
|
|
|
|
|
|
|
|
2016-05-01 07:10:49 -07:00
|
|
|
/**
|
|
|
|
* oil pressure line
|
|
|
|
* adc4/pa4/W47
|
|
|
|
*/
|
2016-05-15 21:02:01 -07:00
|
|
|
engineConfiguration->fsioAdc[0] = EFI_ADC_4;
|
2016-05-01 07:10:49 -07:00
|
|
|
|
|
|
|
|
2016-04-18 20:01:43 -07:00
|
|
|
// warning light
|
|
|
|
/**
|
|
|
|
* to test
|
2016-04-20 10:02:00 -07:00
|
|
|
* set_fsio_setting 0 1800
|
2016-04-19 17:03:53 -07:00
|
|
|
* set_fsio_setting 1 95
|
|
|
|
* set_fsio_setting 3 14
|
2016-04-18 20:01:43 -07:00
|
|
|
*
|
2016-04-20 10:02:00 -07:00
|
|
|
* set_fsio_expression 1 "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
|
|
|
* eval "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |"
|
2016-04-18 20:01:43 -07:00
|
|
|
*/
|
2016-05-15 21:02:01 -07:00
|
|
|
engineConfiguration->bc.fsio_setting[0] = 6000; // RPM threshold
|
2016-04-20 10:02:00 -07:00
|
|
|
engineConfiguration->bc.fsio_setting[1] = 90; // CLT threshold
|
2016-05-15 21:02:01 -07:00
|
|
|
engineConfiguration->bc.fsio_setting[2] = 13.0; // voltage threshold
|
2016-04-18 20:01:43 -07:00
|
|
|
|
2016-04-20 10:02:00 -07:00
|
|
|
setFsio(0, GPIOC_13, "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |" PASS_ENGINE_PARAMETER);
|
2016-04-16 15:01:43 -07:00
|
|
|
|
2016-05-17 22:01:38 -07:00
|
|
|
boardConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
|
|
|
|
boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
|
|
|
|
boardConfiguration->ignitionPins[2] = GPIOC_7; // Frankenso high side - pin 1H
|
|
|
|
boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
|
|
|
|
|
|
|
|
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
|
|
|
|
|
|
|
boardConfiguration->injectionPins[0] = GPIOB_9; // #1
|
|
|
|
boardConfiguration->injectionPins[1] = GPIOE_2; // #2
|
|
|
|
boardConfiguration->injectionPins[2] = GPIOB_8; // #3
|
|
|
|
boardConfiguration->injectionPins[3] = GPIOB_7; // #4
|
|
|
|
|
|
|
|
|
2016-04-16 15:01:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|