don't require EXTERN_ENGINE in every file (#2969)

* move enginePins

* no more extern engine

* uses

* more

* extern config too

* put this where it belongs

* include correct header

* merge
This commit is contained in:
Matthew Kennedy 2021-07-16 15:13:33 -07:00 committed by GitHub
parent f87d1c425e
commit 2ce7777865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
200 changed files with 37 additions and 441 deletions

View File

@ -15,8 +15,6 @@
#include "tps.h"
#include "trigger_input.h"
EXTERN_ENGINE;
void setBoardDefaultConfiguration(void) {
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);

View File

@ -17,8 +17,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
static void hellenWbo() {
engineConfiguration->enableAemXSeries = true;
}

View File

@ -17,8 +17,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
static void hellenWbo() {
engineConfiguration->enableAemXSeries = true;
}

View File

@ -17,8 +17,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
static void hellenWbo() {
engineConfiguration->enableAemXSeries = true;
}

View File

@ -17,8 +17,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
static void setInjectorPins() {
engineConfiguration->injectionPins[0] = GPIOG_7;
engineConfiguration->injectionPins[1] = GPIOG_8;

View File

@ -17,8 +17,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
static void hellenWbo() {
engineConfiguration->enableAemXSeries = true;
}

View File

@ -14,8 +14,6 @@
#include "engine_math.h"
#include "tps.h"
EXTERN_ENGINE;
#if 0
char __debugBuffer[80];
int __debugEnabled = 0;

View File

@ -25,8 +25,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
static void setInjectorPins() {
engineConfiguration->injectionPins[0] = TLE8888_PIN_1;
engineConfiguration->injectionPins[1] = TLE8888_PIN_2;

View File

@ -13,8 +13,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
// Warning! This is a test config!
#undef SERIAL_SPEED

View File

@ -14,8 +14,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
#ifdef STM32F469xx
static bool is469 = true;
#else

View File

@ -11,8 +11,6 @@
#include "allsensors.h"
#include "fsio_impl.h"
EXTERN_ENGINE;
static const brain_pin_e injPins[] = {
GPIOD_7,
GPIOG_9,

View File

@ -34,8 +34,6 @@
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
// An example of how to configure complex features on the board.
// Generally these should be local (static) functions, one function per chip.

View File

@ -16,8 +16,6 @@
#include "smart_gpio.h"
#include "drivers/gpio/mc33810.h"
EXTERN_ENGINE;
void setPinConfigurationOverrides(void) {
}

View File

@ -18,8 +18,6 @@
#include "allsensors.h"
#include "advance_map.h"
EXTERN_CONFIG;
static void setDefault139qmbMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX);
setTimingRpmBin(1000, 11000 PASS_CONFIG_PARAMETER_SUFFIX);

View File

@ -80,8 +80,6 @@
#include "electronic_throttle.h"
#endif // EFI_ELECTRONIC_THROTTLE_BODY
EXTERN_CONFIG;
void m73engine(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// 13641435991 injector
engineConfiguration->injector.flow = 180; // cc/min, who knows if this number is real - no good source of info

View File

@ -63,8 +63,6 @@
#include "bmw_m73.h"
#include "fsio_impl.h"
EXTERN_CONFIG;
void setEngineBMW_M73_microRusEfi(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// 13641435991 injector
engineConfiguration->injector.flow = 180; // cc/min, who knows if this number is real - no good source of info

View File

@ -12,8 +12,6 @@
#include "engine_math.h"
#include "custom_engine.h"
EXTERN_CONFIG;
void setCamaro4(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -39,8 +39,6 @@ static const uint8_t default_tps_advance_table[16][16] = {
//static const float rpmSteps[16] = {400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 3600, 4000, 4400, 4800, 5200, 5600, 6000, 6400};
//static const float mapSteps[16] = {25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100};
EXTERN_CONFIG;
void setCitroenBerlingoTU3JPConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -26,8 +26,6 @@
#include "scheduler.h"
#endif /* EFI_PROD_CODE */
EXTERN_ENGINE;
#if EFI_PROD_CODE
static int periodIndex = 0;

View File

@ -86,8 +86,6 @@ static const uint8_t veDodgeNeon2003Table[16][16] = {
};
EXTERN_CONFIG;
void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -13,8 +13,6 @@
#include "allsensors.h"
#include "engine_math.h"
EXTERN_CONFIG;
void setDodgeRam1996(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -8,8 +8,6 @@
#include "engine_template.h"
#include "custom_engine.h"
EXTERN_CONFIG;
void setEngineTemplateConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
}

View File

@ -16,8 +16,6 @@
#include "engine_math.h"
#include "allsensors.h"
EXTERN_CONFIG;
/**
* @brief Default values for persistent properties
*/

View File

@ -40,8 +40,6 @@ static const int8_t default_aspire_timing_table[16][16] = {
};
#endif
EXTERN_CONFIG;
static void setDefaultAspireMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX);
setTimingRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX);

View File

@ -62,8 +62,6 @@ static const uint8_t racingFestivaVeTable[16][16] = {
{/* 15 160.000 *//* 0 800.0*/100, /* 1 1200.0*/100, /* 2 1600.0*/100, /* 3 2000.0*/100, /* 4 2400.0*/100, /* 5 2800.0*/120, /* 6 3200.0*/120, /* 7 3600.0*/120, /* 8 4100.0*/120, /* 9 4500.0*/120, /* 10 4900.0*/120, /* 11 5300.0*/120, /* 12 5700.0*/120, /* 13 6100.0*/120, /* 14 6500.0*/120, /* 15 7000.0*/120, },
};
EXTERN_CONFIG;
/**
* pin 1I/W9 - extra +5v
* set engine_type 14

View File

@ -34,8 +34,6 @@ static const uint8_t default_custom_timing_table[16][16] = {
};
#endif
EXTERN_CONFIG;
static void setDefaultCustomMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setTimingLoadBin(0,100 PASS_CONFIG_PARAMETER_SUFFIX);
setTimingRpmBin(0,7000 PASS_CONFIG_PARAMETER_SUFFIX);

View File

@ -35,8 +35,6 @@
#include "advance_map.h"
#include "custom_engine.h"
EXTERN_CONFIG;
static void setHondaAccordConfigurationCommon(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->map.sensor.type = MT_DENSO183;

View File

@ -11,8 +11,6 @@
#include "custom_engine.h"
#include "fsio_impl.h"
EXTERN_CONFIG;
#if (BOARD_TLE8888_COUNT > 0)
void setLadaKalina(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
/* MRE uses TLE8888_PIN_21 for fuel pump */

View File

@ -8,8 +8,6 @@
#include "m111.h"
EXTERN_CONFIG;
void setM111EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
}

View File

@ -15,8 +15,6 @@
#include "fsio_impl.h"
#include "settings.h"
EXTERN_CONFIG;
void setMazda626EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -75,8 +75,6 @@ static const uint8_t miataNA8_maf_advance_table[16][16] = { {/*0 engineLoad=1.2
+29, /*12 5760.0*/+28, /*13 6173.0*/+28, /*14 6586.0*/+27, /*15 7000.0*/+27 } };
#endif
EXTERN_ENGINE;
static void commonMiataNa(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA;
engineConfiguration->engineChartSize = 100;

View File

@ -18,8 +18,6 @@
#include "mazda_miata_1_6.h"
#include "mazda_miata_base_maps.h"
EXTERN_CONFIG;
static const float hardCodedmafDecodingBins[256] = {0.099999905, 0.19999981, 0.29999924, 0.39999962, 0.5, 0.5999985, 0.70000076, 0.79999924, 0.9000015, 1.0, 1.0999985, 1.199997, 1.300003, 1.4000015, 1.5, 1.5999985, 1.699997, 1.800003, 1.9000015, 2.0, 2.100006, 2.2000122, 2.2999878, 2.399994, 2.5, 2.600006, 2.7000122, 2.7999878, 2.899994, 3.0, 3.100006, 3.2000122, 3.2999878, 3.399994, 3.5, 3.600006, 3.7000122, 3.7999878, 3.899994, 4.0, 4.0999756, 4.200012, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988, 4.299988};
static const float hardCodedmafDecoding[256] = {570.0, 437.0, 351.5, 293.55078, 237.0, 186.0, 145.0, 116.0, 96.0, 78.84961, 65.549805, 56.049805, 48.0, 40.0, 33.25, 29.449951, 25.649902, 22.800049, 20.899902, 19.0, 17.100098, 16.149902, 13.775024, 12.824951, 11.400024, 10.449951, 9.5, 8.550049, 8.454956, 8.359985, 8.300049, 8.199951, 7.5999756, 7.125, 7.125, 7.125, 6.6500244, 6.6500244, 6.6500244, 6.6500244, 6.6500244, 6.6500244, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};

View File

@ -8,8 +8,6 @@
#include "engine_configuration.h"
#include "table_helper.h"
EXTERN_CONFIG;
// todo: use these defaults wider? make them global defaults maybe?
static const float hardCodedcrankingFuelBins[8] = {-20.0, -10.0, 3.6799927, 22.77002, 34.049805, 49.95996, 65.0, 90.0};
static const float hardCodedcrankingFuelCoef[8] = {2.7999878, 2.2000122, 1.6900024, 1.2900009, 1.199997, 1.050003, 1.0, 1.0};

View File

@ -20,8 +20,6 @@
#include "ego.h"
#include "thermistors.h"
EXTERN_CONFIG;
// todo: why would this not work?
//extern const float mazda_miata_nb2_RpmBins[FUEL_RPM_COUNT];
//extern const float mazda_miata_nb2_LoadBins[FUEL_LOAD_COUNT];

View File

@ -13,8 +13,6 @@
#include "custom_engine.h"
#include "mazda_miata_1_6.h"
EXTERN_CONFIG;
/**
* 1994, 1995 NA
* Note that ODB-II car have different wiring!

View File

@ -15,8 +15,6 @@
#include "mazda_miata_nb.h"
#include "thermistors.h"
EXTERN_CONFIG;
void setMazdaMiataNb1EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -54,8 +54,6 @@
#include "mazda_miata_base_maps.h"
#include "hip9011_logic.h"
EXTERN_CONFIG;
static const float injectorLagBins[VBAT_INJECTOR_CURVE_SIZE] = {
6.0, 8.0, 10.0, 11.0,
12.0, 13.0, 14.0, 15.0

View File

@ -14,8 +14,6 @@
#include "engine_configuration.h"
#include "cj125.h"
EXTERN_ENGINE;
/**
* set engine_type 102
*/

View File

@ -14,8 +14,6 @@
#include "mitsubishi.h"
#include "allsensors.h"
EXTERN_CONFIG;
void setMitsubishiConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -12,8 +12,6 @@
#include "nissan_primera.h"
EXTERN_CONFIG;
void setNissanPrimeraEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -7,8 +7,6 @@
#include "nissan_vq.h"
EXTERN_CONFIG;
void setHellen121nissan(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->trigger.type = TT_NISSAN_VQ;

View File

@ -12,8 +12,6 @@
#include "allsensors.h"
#include "engine_math.h"
EXTERN_CONFIG;
void setSachs(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -12,8 +12,6 @@
#include "custom_engine.h"
#include "allsensors.h"
EXTERN_CONFIG;
void setSubaru2003Wrx(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankenso_01_LCD(engineConfiguration);
setFrankenso0_1_joystick(engineConfiguration);

View File

@ -15,8 +15,6 @@
#include "test_engine.h"
#include "engine_math.h"
EXTERN_CONFIG;
// TEST_ENGINE
void setTestEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);

View File

@ -22,8 +22,6 @@
#include "thermistors.h"
#include "mazda_miata_vvt.h"
EXTERN_CONFIG;
static void common2jz(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); // default pinout

View File

@ -13,8 +13,6 @@
#include "ego.h"
#include "engine_math.h"
EXTERN_CONFIG;
// VW_ABA
// set engine_type 32
void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE) {

View File

@ -11,8 +11,6 @@
#include "table_helper.h"
#include "map.h"
EXTERN_CONFIG;
/**
* set engine_type 62
* VW_B6

View File

@ -44,8 +44,6 @@ static THD_WORKING_AREA(btThreadStack, UTILITY_THREAD_STACK_SIZE);
static thread_t *btThread = nullptr;
static thread_reference_t btThreadRef = nullptr; // used by thread suspend/resume as a flag
EXTERN_ENGINE;
// Main communication code
// We assume that the user has disconnected the software before starting the code.

View File

@ -12,8 +12,6 @@
#if EFI_TOOTH_LOGGER
EXTERN_ENGINE;
#include <cstddef>
#include "efitime.h"
#include "efilib.h"

View File

@ -97,8 +97,6 @@
#if EFI_TUNER_STUDIO
EXTERN_ENGINE;
/* 1S */
#define TS_COMMUNICATION_TIMEOUT TIME_MS2I(1000)

View File

@ -13,8 +13,6 @@
#include "rusEfiFunctionalTest.h"
#endif // EFI_SIMULATOR
EXTERN_ENGINE;
#if EFI_PROD_CODE || EFI_SIMULATOR
size_t TsChannelBase::read(uint8_t* buffer, size_t size) {
return readTimeout(buffer, size, SR5_READ_TIMEOUT);

View File

@ -11,8 +11,6 @@
#include "tunerstudio_io.h"
#include "connector_uart_dma.h"
EXTERN_ENGINE;
#if (!defined(TS_NO_PRIMARY) && (defined(TS_PRIMARY_UART) || defined(TS_PRIMARY_SERIAL)))
#define HAS_PRIMARY true
#else

View File

@ -45,8 +45,6 @@
#include "rusEfiFunctionalTest.h"
#endif /*EFI_SIMULATOR */
EXTERN_ENGINE;
bool consoleByteArrived = false;
void onDataArrived(bool valid) {

View File

@ -141,8 +141,6 @@ static uint64_t binaryLogCount = 0;
#endif /* EFI_FILE_LOGGING */
EXTERN_ENGINE;
/**
* This is useful if we are changing engine mode dynamically
* For example http://rusefi.com/forum/viewtopic.php?f=5&t=1085

View File

@ -6,8 +6,6 @@
#include "sensor.h"
#include "tunerstudio_outputs.h"
EXTERN_ENGINE;
// Deadbands to prevent rapid switching on/off of AC
static Deadband<200> maxRpmDeadband;
static Deadband<5> maxCltDeadband;

View File

@ -29,8 +29,6 @@
#error "Unexpected OS ACCESS HERE"
#endif /* HAS_OS_ACCESS */
EXTERN_ENGINE;
static SimplePwm alternatorControl("alt");
static PidIndustrial alternatorPid(&persistentState.persistentConfiguration.engineConfiguration.alternatorControl);

View File

@ -25,8 +25,6 @@
#error "Unexpected OS ACCESS HERE"
#endif
EXTERN_ENGINE;
static boostOpenLoop_Map3D_t boostMapOpen;
static boostOpenLoop_Map3D_t boostMapClosed;
static SimplePwm boostPwmControl("boost");

View File

@ -17,8 +17,6 @@
#include "efi_gpio.h"
#include "pwm_generator_logic.h"
EXTERN_ENGINE;
class DcHardware {
private:
OutputPin m_pinEnable;

View File

@ -95,8 +95,6 @@
static pedal2tps_t pedal2tpsMap;
EXTERN_ENGINE;
constexpr float etbPeriodSeconds = 1.0f / ETB_LOOP_FREQUENCY;
static bool startupPositionError = false;

View File

@ -5,8 +5,6 @@
#include "efi_gpio.h"
#include "sensor.h"
EXTERN_ENGINE;
static void fanControl(bool acActive, OutputPin& pin, int8_t fanOnTemp, int8_t fanOffTemp, bool enableWithAc, bool disableWhenStopped DECLARE_ENGINE_PARAMETER_SUFFIX) {
auto [cltValid, clt] = Sensor::get(SensorType::Clt);

View File

@ -6,8 +6,6 @@
#include "gppwm_channel.h"
#include "pwm_generator_logic.h"
EXTERN_ENGINE;
static GppwmChannel channels[GPPWM_CHANNELS];
static OutputPin pins[GPPWM_CHANNELS];
static SimplePwm outputs[GPPWM_CHANNELS];

View File

@ -8,8 +8,6 @@
#include "sensor.h"
#include "engine_math.h"
EXTERN_ENGINE;
expected<float> readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX) {
switch (channel) {
case GPPWM_Tps:

View File

@ -26,8 +26,6 @@ static DualHBridgeStepper iacHbridgeHw;
StepperMotor iacMotor;
#endif /* EFI_UNIT_TEST */
EXTERN_ENGINE;
/**
* When the IAC position value change is insignificant (lower than this threshold), leave the poor valve alone
* todo: why do we have this logic? is this ever useful?

View File

@ -47,8 +47,6 @@
#include "stepper.h"
#endif
EXTERN_ENGINE;
// todo: move all static vars to engine->engineState.idle?
static bool shouldResetPid = false;

View File

@ -19,8 +19,6 @@ static SimplePwm pwmTest[5];
extern OutputPin warningLedPin;
EXTERN_ENGINE;
static void startPwmTest(int freq) {
efiPrintf("running pwm test @%d", freq);

View File

@ -20,8 +20,6 @@
#error "Unexpected OS ACCESS HERE"
#endif /* HAS_OS_ACCESS */
EXTERN_ENGINE;
static fsio8_Map3D_u8t vvtTable1;
static fsio8_Map3D_u8t vvtTable2;

View File

@ -32,8 +32,6 @@
#include "tunerstudio_outputs.h"
#endif /* EFI_TUNER_STUDIO */
EXTERN_ENGINE;
static tps_tps_Map3D_t tpsTpsMap;
void WallFuel::resetWF() {

View File

@ -31,8 +31,6 @@
#if EFI_ENGINE_CONTROL
EXTERN_ENGINE;
static ign_Map3D_t advanceMap;
static ign_Map3D_t iatAdvanceCorrectionMap;

View File

@ -2,8 +2,6 @@
#include "sensor.h"
#include "idle_thread.h"
EXTERN_ENGINE;
AirmassVeModelBase::AirmassVeModelBase(const ValueProvider3D& veTable) : m_veTable(&veTable) {}
float AirmassVeModelBase::getVeLoadAxis(float passedLoad) const {

View File

@ -3,8 +3,6 @@
#include "maf_airmass.h"
#include "maf.h"
EXTERN_ENGINE;
AirmassResult MafAirmass::getAirmass(int rpm) {
float maf = Sensor::get(SensorType::Maf).value_or(0) + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE);
return getAirmassImpl(maf, rpm);

View File

@ -3,8 +3,6 @@
#include "speed_density_airmass.h"
#include "perf_trace.h"
EXTERN_ENGINE;
AirmassResult SpeedDensityAirmass::getAirmass(int rpm) {
ScopePerf perf(PE::GetSpeedDensityFuel);

View File

@ -10,8 +10,6 @@
#include "global.h"
#include "speed_density_base.h"
EXTERN_ENGINE;
/**
* Derived via:
* (8.31 J K mol^-1) <- ideal gas constant R

View File

@ -1,8 +1,6 @@
#include "defaults.h"
#include "engine_configuration.h"
EXTERN_CONFIG;
static void setDefaultAlternatorParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->alternatorOffAboveTps = 120;

View File

@ -2,8 +2,6 @@
#include "engine_configuration.h"
#include "table_helper.h"
EXTERN_CONFIG;
void setDefaultCranking(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->cranking.rpm = 550;

View File

@ -3,8 +3,6 @@
#include "table_helper.h"
#include "mazda_miata_vvt.h"
EXTERN_CONFIG;
static void setBosch02880155868(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// http://www.boschdealer.com/specsheets/0280155868cs.jpg
engineConfiguration->injector.battLagCorrBins[0] = 6;

View File

@ -3,8 +3,6 @@
#include "engine_math.h"
#include "table_helper.h"
EXTERN_CONFIG;
static void setDefaultMultisparkParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// 1ms spark + 2ms dwell
engineConfiguration->multisparkSparkDuration = 1000;

View File

@ -17,8 +17,6 @@
extern TunerStudioOutputChannels tsOutputChannels;
#endif /* EFI_TUNER_STUDIO */
EXTERN_ENGINE;
DynoView dynoInstance;
void DynoView::update(vssSrc src) {

View File

@ -55,8 +55,6 @@
#include "gpio/tle8888.h"
#endif
EXTERN_ENGINE;
#if EFI_ENGINE_SNIFFER
#include "engine_sniffer.h"
extern int waveChartUsedSize;

View File

@ -404,4 +404,8 @@ void doScheduleStopEngine(DECLARE_ENGINE_PARAMETER_SIGNATURE);
#define HW_CHECK_RPM 200
// These externs aren't needed for unit tests - everything is injected instead
#if !EFI_UNIT_TEST
extern Engine ___engine;
extern Engine *engine;
#endif // EFI_UNIT_TEST

View File

@ -30,8 +30,6 @@
#include "status_loop.h"
#endif
EXTERN_ENGINE;
WarningCodeState::WarningCodeState() {
clear();
}

View File

@ -107,8 +107,6 @@
#include "tunerstudio.h"
#endif
EXTERN_ENGINE;
//#define TS_DEFAULT_SPEED 115200
#define TS_DEFAULT_SPEED 38400

View File

@ -59,3 +59,31 @@ void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void setBoardDefaultConfiguration(void);
void setBoardConfigOverrides(void);
#if !EFI_UNIT_TEST
extern engine_configuration_s *engineConfiguration;
extern persistent_config_container_s persistentState;
extern persistent_config_s *config;
#endif // EFI_UNIT_TEST
/**
* & is reference in C++ (not C)
* Ref is a pointer that:
* you access with dot instead of arrow
* Cannot be null
* This is about EFI_ACTIVE_CONFIGURATION_IN_FLASH
*/
extern engine_configuration_s & activeConfiguration;
#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
// We store a special changeable copy of configuration is RAM, so we can just compare them
#define isConfigurationChanged(x) (engineConfiguration->x != activeConfiguration.x)
#else
// We cannot call prepareVoidConfiguration() for activeConfiguration if it's stored in flash,
// so we need to tell the firmware that it's "void" (i.e. zeroed, invalid) by setting a special flag variable,
// and then we consider 'x' as changed if it's just non-zero.
extern bool isActiveConfigurationVoid;
#define isConfigurationChanged(x) ((engineConfiguration->x != activeConfiguration.x) || (isActiveConfigurationVoid && engineConfiguration->x != 0))
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
#define isPinOrModeChanged(pin, mode) (isConfigurationChanged(pin) || isConfigurationChanged(mode))

View File

@ -1,8 +1,6 @@
#include "fuel_computer.h"
#include "map.h"
EXTERN_ENGINE;
mass_t FuelComputerBase::getCycleFuel(mass_t airmass, int rpm, float load) const {
load = getTargetLambdaLoadAxis(load);

View File

@ -2,8 +2,6 @@
#include "tunerstudio_outputs.h"
#include "map.h"
EXTERN_ENGINE;
void InjectorModelBase::prepare() {
m_massFlowRate = getInjectorMassFlowRate();
float deadtime = getDeadtime();

View File

@ -40,8 +40,6 @@
#include "speed_density_base.h"
#include "lua_hooks.h"
EXTERN_ENGINE;
static fuel_Map3D_t fuelPhaseMap;
extern fuel_Map3D_t veMap;
extern lambda_Map3D_t lambdaMap;

View File

@ -33,8 +33,6 @@ LaunchControlBase launchInstance;
extern TunerStudioOutputChannels tsOutputChannels;
#endif /* EFI_TUNER_STUDIO */
EXTERN_ENGINE;
static int retardThresholdRpm;
/**

View File

@ -58,8 +58,6 @@
#include "gpio/tle8888.h"
#endif // BOARD_TLE8888_COUNT
EXTERN_ENGINE;
static bool isRunningBench = false;
bool isRunningBenchTest(void) {

View File

@ -8,8 +8,6 @@
#include "buttonshift.h"
#include "engine.h"
EXTERN_ENGINE;
ButtonShiftController buttonShiftController;

View File

@ -19,8 +19,6 @@
#include "vehicle_speed.h"
#include "rtc_helper.h"
#include "fuel_math.h"
EXTERN_ENGINE;
// CAN Bus ID for broadcast
/**
* e46 data is from http://forums.bimmerforums.com/forum/showthread.php?1887229

View File

@ -11,9 +11,6 @@
#include "global.h"
#include "engine.h"
EXTERN_ENGINE
;
typedef float fsio_table_8x8_f32t_linear[FSIO_TABLE_8 * FSIO_TABLE_8];
bool acceptCanRx(int sid DECLARE_ENGINE_PARAMETER_SUFFIX) {

View File

@ -19,8 +19,6 @@
#include "thread_priority.h"
#include "rusefi_wideband.h"
EXTERN_ENGINE;
extern CanListener* canListeners_head;

View File

@ -20,8 +20,6 @@
#include "spark_logic.h"
#include "vehicle_speed.h"
EXTERN_ENGINE;
struct Status {
uint16_t warningCounter;
uint16_t lastErrorCode;

View File

@ -15,8 +15,6 @@
#include "vehicle_speed.h"
#include "dynoview.h"
EXTERN_ENGINE;
static bool isInit = false;
static uint16_t filterCanID = 0;
static efitick_t frameTime;

View File

@ -37,8 +37,6 @@
#include "fuel_math.h"
#include "thermistors.h"
EXTERN_ENGINE;
static const int16_t supportedPids0120[] = {
PID_MONITOR_STATUS,
PID_FUEL_SYSTEM_STATUS,

View File

@ -12,8 +12,6 @@
// This array contains the firmware image for the wideband contoller
#include "wideband_firmware/for_rusefi/wideband_image.h"
EXTERN_ENGINE;
#define EVT_BOOTLOADER_ACK EVENT_MASK(0)
static thread_t* waitingBootloaderThread = nullptr;

View File

@ -75,20 +75,6 @@
#define DISPLAY_SENSOR(x) {}
#define DISPLAY_IF(x) x
#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
// We store a special changeable copy of configuration is RAM, so we can just compare them
#define isConfigurationChanged(x) (engineConfiguration->x != activeConfiguration.x)
#else
// We cannot call prepareVoidConfiguration() for activeConfiguration if it's stored in flash,
// so we need to tell the firmware that it's "void" (i.e. zeroed, invalid) by setting a special flag variable,
// and then we consider 'x' as changed if it's just non-zero.
extern bool isActiveConfigurationVoid;
#define isConfigurationChanged(x) ((engineConfiguration->x != activeConfiguration.x) || (isActiveConfigurationVoid && engineConfiguration->x != 0))
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
#define isPinOrModeChanged(pin, mode) (isConfigurationChanged(pin) || isConfigurationChanged(mode))
#ifndef FIRMWARE_ID
#define FIRMWARE_ID "source"
#endif

View File

@ -19,7 +19,6 @@
class Engine;
#endif // def __cplusplus
struct engine_configuration_s;
struct persistent_config_s;
@ -49,12 +48,9 @@ struct persistent_config_s;
#define PASS_ENGINE_PARAMETER_SIGNATURE engine, PASS_CONFIG_PARAMETER_SIGNATURE
#define PASS_ENGINE_PARAMETER_SUFFIX , PASS_ENGINE_PARAMETER_SIGNATURE
#define EXTERN_ENGINE extern EnginePins enginePins; \
extern engine_configuration_s & activeConfiguration
#define EXTERN_ENGINE extern engine_configuration_s & activeConfiguration
#endif // def __cplusplus
#define EXTERN_CONFIG
#define DEFINE_CONFIG_PARAM(x, y) , x y
#define PASS_CONFIG_PARAM(x) , x
@ -88,12 +84,6 @@ struct persistent_config_s;
// Pass this after some other parameters are passed
#define PASS_ENGINE_PARAMETER_SUFFIX
#define EXTERN_ENGINE \
extern Engine ___engine; \
extern Engine *engine; \
EXTERN_CONFIG \
extern EnginePins enginePins \
#define ENGINE(x) ___engine.x
#endif // def __cplusplus
@ -107,23 +97,6 @@ struct persistent_config_s;
*/
#define CONFIG(x) persistentState.persistentConfiguration.engineConfiguration.x
/**
* & is reference in C++ (not C)
* Ref is a pointer that:
* you access with dot instead of arrow
* Cannot be null
* This is about EFI_ACTIVE_CONFIGURATION_IN_FLASH
*/
#define EXTERN_CONFIG \
EXTERN_ENGINE_CONFIGURATION \
extern engine_configuration_s & activeConfiguration; \
#define EXTERN_ENGINE_CONFIGURATION \
extern engine_configuration_s *engineConfiguration; \
extern persistent_config_container_s persistentState; \
extern persistent_config_s *config;
#define DEFINE_CONFIG_PARAM(x, y)
#define CONFIG_PARAM(x) CONFIG(x)
#define PASS_CONFIG_PARAM(x)

View File

@ -16,8 +16,6 @@ static critical_msg_t criticalErrorMessageBuffer;
#include "HD44780.h"
#endif /* EFI_HD44780_LCD */
EXTERN_ENGINE;
extern int warningEnabled;
bool hasFirmwareErrorFlag = false;

View File

@ -21,8 +21,6 @@
#include "fsio_core.h"
#include "fsio_impl.h"
EXTERN_ENGINE;
LENameOrdinalPair * LE_FIRST = nullptr;
/**

View File

@ -16,8 +16,6 @@
#include "allsensors.h"
#include "sensor.h"
EXTERN_ENGINE;
#if EFI_PROD_CODE
// todo: that's about bench test mode, wrong header for sure!

Some files were not shown because too many files have changed in this diff Show More