This commit is contained in:
rusefi 2019-11-05 20:07:55 -05:00
parent 801b2eb70e
commit cc6381fe96
6 changed files with 20 additions and 4 deletions

View File

@ -125,9 +125,10 @@ static void setWarningEnabled(int value) {
// this one needs to be in main ram so that SD card SPI DMA works fine // this one needs to be in main ram so that SD card SPI DMA works fine
static char FILE_LOGGER[1000] MAIN_RAM; static char FILE_LOGGER[1000] MAIN_RAM;
static Logging fileLogger("file logger", FILE_LOGGER, sizeof(FILE_LOGGER)); static Logging fileLogger("file logger", FILE_LOGGER, sizeof(FILE_LOGGER));
static int logFileLineIndex = 0;
#endif /* EFI_FILE_LOGGING */ #endif /* EFI_FILE_LOGGING */
static int logFileLineIndex = 0;
#define TAB "\t" #define TAB "\t"
static void reportSensorF(Logging *log, const char *caption, const char *units, float value, static void reportSensorF(Logging *log, const char *caption, const char *units, float value,
@ -151,6 +152,9 @@ static void reportSensorF(Logging *log, const char *caption, const char *units,
appendFloat(log, value, precision); appendFloat(log, value, precision);
append(log, TAB); append(log, TAB);
} }
#else
UNUSED(log);UNUSED(caption);UNUSED(units);UNUSED(value);
UNUSED(precision);
#endif /* EFI_FILE_LOGGING */ #endif /* EFI_FILE_LOGGING */
} }
} }
@ -166,6 +170,8 @@ static void reportSensorI(Logging *log, const char *caption, const char *units,
} else { } else {
appendPrintf(log, "%d%s", value, TAB); appendPrintf(log, "%d%s", value, TAB);
} }
#else
UNUSED(log);UNUSED(caption);UNUSED(units);UNUSED(value);
#endif /* EFI_FILE_LOGGING */ #endif /* EFI_FILE_LOGGING */
} }
@ -188,6 +194,7 @@ static float getAirFlowGauge(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
return hasMafSensor() ? getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE) : engine->engineState.airFlow; return hasMafSensor() ? getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE) : engine->engineState.airFlow;
} }
#if EFI_FILE_LOGGING
static void printSensors(Logging *log) { static void printSensors(Logging *log) {
bool fileFormat = true; // todo:remove this unused variable bool fileFormat = true; // todo:remove this unused variable
// current time, in milliseconds // current time, in milliseconds
@ -381,6 +388,8 @@ static void printSensors(Logging *log) {
reportSensorI(log, INDICATOR_NAME_AC_SWITCH, "bool", engine->acSwitchState); reportSensorI(log, INDICATOR_NAME_AC_SWITCH, "bool", engine->acSwitchState);
} }
#endif /* EFI_FILE_LOGGING */
void writeLogLine(void) { void writeLogLine(void) {
#if EFI_FILE_LOGGING #if EFI_FILE_LOGGING
@ -571,7 +580,7 @@ static void showFuelInfo(void) {
} }
#endif #endif
static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin, &enginePins.checkEnginePin, static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin,
&enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin }; &enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin };
static void initStatusLeds(void) { static void initStatusLeds(void) {

View File

@ -519,6 +519,7 @@ void startETBPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
); );
} }
#if EFI_PROD_CODE && 0
static void setTempOutput(float value) { static void setTempOutput(float value) {
autoTune.output = value; autoTune.output = value;
} }
@ -540,6 +541,7 @@ static void setAutoOffset(int offset) {
tuneWorkingPidSettings.offset = offset; tuneWorkingPidSettings.offset = offset;
autoTune.reset(); autoTune.reset();
} }
#endif
void setDefaultEtbBiasCurve(DECLARE_CONFIG_PARAMETER_SIGNATURE) { void setDefaultEtbBiasCurve(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->etbBiasBins[0] = 0; engineConfiguration->etbBiasBins[0] = 0;

View File

@ -25,7 +25,8 @@ static void turnTachPinLow(void) {
static void tachSignalCallback(trigger_event_e ckpSignalType, static void tachSignalCallback(trigger_event_e ckpSignalType,
uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) { uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
if (index != engineConfiguration->tachPulseTriggerIndex) { UNUSED(ckpSignalType);
if (index != (uint32_t)engineConfiguration->tachPulseTriggerIndex) {
return; return;
} }
enginePins.tachOut.setHigh(); enginePins.tachOut.setHigh();

View File

@ -113,6 +113,7 @@ EXTERN_ENGINE;
#define xxxxx 0 #define xxxxx 0
#if 0
static fuel_table_t alphaNfuel = { static fuel_table_t alphaNfuel = {
{/*0 engineLoad=0.00*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx}, {/*0 engineLoad=0.00*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx},
{/*1 engineLoad=6.66*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx}, {/*1 engineLoad=6.66*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx},
@ -131,6 +132,7 @@ static fuel_table_t alphaNfuel = {
{/*14 engineLoad=93.33*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx}, {/*14 engineLoad=93.33*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx},
{/*15 engineLoad=100.00*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx} {/*15 engineLoad=100.00*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx}
}; };
#endif
/** /**
* Current engine configuration. On firmware start we assign empty configuration, then * Current engine configuration. On firmware start we assign empty configuration, then
@ -1255,6 +1257,7 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
} }
void emptyCallbackWithConfiguration(engine_configuration_s * engineConfiguration) { void emptyCallbackWithConfiguration(engine_configuration_s * engineConfiguration) {
UNUSED(engineConfiguration);
} }
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) { void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) {

View File

@ -34,7 +34,7 @@ public:
float s_h_c = 0; float s_h_c = 0;
bool isLinear; bool isLinear;
private: private:
thermistor_conf_s currentConfig = {}; thermistor_conf_s currentConfig = {0,0,0,0,0,0,0};
}; };
class Accelerometer { class Accelerometer {

View File

@ -269,6 +269,7 @@ void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
} }
void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX) { void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX) {
(void)previousConfiguration;
#if EFI_FSIO #if EFI_FSIO
applyFsioConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); applyFsioConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
#endif #endif