mirror of https://github.com/rusefi/rusefi.git
auto-sync
This commit is contained in:
parent
855433a577
commit
93631216e0
|
@ -131,9 +131,13 @@ void printSensors(Engine *engine) {
|
||||||
reportSensorF(getCaption(LP_MAP), getMap(), 2);
|
reportSensorF(getCaption(LP_MAP), getMap(), 2);
|
||||||
reportSensorF("map_r", getRawMap(), 2);
|
reportSensorF("map_r", getRawMap(), 2);
|
||||||
}
|
}
|
||||||
|
if (engineConfiguration->hasBaroSensor) {
|
||||||
reportSensorF("baro", getBaroPressure(), 2);
|
reportSensorF("baro", getBaroPressure(), 2);
|
||||||
|
}
|
||||||
|
if (engineConfiguration->hasAfrSensor) {
|
||||||
reportSensorF("afr", getAfr(), 2);
|
reportSensorF("afr", getAfr(), 2);
|
||||||
|
}
|
||||||
|
|
||||||
reportSensorF("vref", getVRef(engineConfiguration), 2);
|
reportSensorF("vref", getVRef(engineConfiguration), 2);
|
||||||
reportSensorF("vbatt", getVBatt(engineConfiguration), 2);
|
reportSensorF("vbatt", getVBatt(engineConfiguration), 2);
|
||||||
|
|
||||||
|
|
|
@ -311,6 +311,10 @@ typedef struct {
|
||||||
|
|
||||||
cranking_parameters_s crankingSettings;
|
cranking_parameters_s crankingSettings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see hasMapSensor
|
||||||
|
* @see isMapAveragingEnabled
|
||||||
|
*/
|
||||||
MAP_sensor_config_s map;
|
MAP_sensor_config_s map;
|
||||||
|
|
||||||
// todo: merge with channel settings, use full-scale Thermistor here!
|
// todo: merge with channel settings, use full-scale Thermistor here!
|
||||||
|
@ -437,6 +441,9 @@ typedef struct {
|
||||||
adc_channel_e iatAdcChannel;
|
adc_channel_e iatAdcChannel;
|
||||||
adc_channel_e mafAdcChannel;
|
adc_channel_e mafAdcChannel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see hasAfrSensor
|
||||||
|
*/
|
||||||
afr_sensor_s afrSensor;
|
afr_sensor_s afrSensor;
|
||||||
|
|
||||||
float injectionOffset;
|
float injectionOffset;
|
||||||
|
@ -445,6 +452,9 @@ typedef struct {
|
||||||
|
|
||||||
float diffLoadEnrichmentCoef;
|
float diffLoadEnrichmentCoef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see hasBaroSensor
|
||||||
|
*/
|
||||||
air_pressure_sensor_config_s baroSensor;
|
air_pressure_sensor_config_s baroSensor;
|
||||||
|
|
||||||
float veLoadBins[FUEL_LOAD_COUNT];
|
float veLoadBins[FUEL_LOAD_COUNT];
|
||||||
|
@ -461,6 +471,9 @@ typedef struct {
|
||||||
|
|
||||||
board_configuration_s bc;
|
board_configuration_s bc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see isMapAveragingEnabled
|
||||||
|
*/
|
||||||
bool_t hasMapSensor : 1; // bit 0
|
bool_t hasMapSensor : 1; // bit 0
|
||||||
bool_t hasIatSensor : 1; // bit 1
|
bool_t hasIatSensor : 1; // bit 1
|
||||||
bool_t hasBaroSensor : 1; // bit 1
|
bool_t hasBaroSensor : 1; // bit 1
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
CONTROLLERSSRC = \
|
CONTROLLERSSRC = \
|
||||||
controllers/ignition_central.c \
|
controllers/ignition_central.c \
|
||||||
$(PROJECT_DIR)/controllers/malfunction_indicator.c \
|
|
||||||
$(PROJECT_DIR)/controllers/error_handling.c
|
$(PROJECT_DIR)/controllers/error_handling.c
|
||||||
|
|
||||||
CONTROLLERS_SRC_CPP = $(PROJECT_DIR)/controllers/settings.cpp \
|
CONTROLLERS_SRC_CPP = $(PROJECT_DIR)/controllers/settings.cpp \
|
||||||
|
@ -12,6 +11,7 @@ CONTROLLERS_SRC_CPP = $(PROJECT_DIR)/controllers/settings.cpp \
|
||||||
controllers/injector_central.cpp \
|
controllers/injector_central.cpp \
|
||||||
controllers/idle_thread.cpp \
|
controllers/idle_thread.cpp \
|
||||||
controllers/PwmTester.cpp \
|
controllers/PwmTester.cpp \
|
||||||
|
$(PROJECT_DIR)/controllers/malfunction_indicator.cpp \
|
||||||
$(PROJECT_DIR)/controllers/alternatorController.cpp \
|
$(PROJECT_DIR)/controllers/alternatorController.cpp \
|
||||||
$(PROJECT_DIR)/controllers/lcd_controller.cpp \
|
$(PROJECT_DIR)/controllers/lcd_controller.cpp \
|
||||||
$(PROJECT_DIR)/controllers/engine_controller.cpp
|
$(PROJECT_DIR)/controllers/engine_controller.cpp
|
||||||
|
|
|
@ -513,13 +513,13 @@ void initEngineContoller(Engine *engine) {
|
||||||
|
|
||||||
#if EFI_MALFUNCTION_INDICATOR
|
#if EFI_MALFUNCTION_INDICATOR
|
||||||
if (engineConfiguration->isMilEnabled) {
|
if (engineConfiguration->isMilEnabled) {
|
||||||
initMalfunctionIndicator();
|
initMalfunctionIndicator(engine);
|
||||||
}
|
}
|
||||||
#endif /* EFI_MALFUNCTION_INDICATOR */
|
#endif /* EFI_MALFUNCTION_INDICATOR */
|
||||||
|
|
||||||
#if EFI_MAP_AVERAGING
|
#if EFI_MAP_AVERAGING
|
||||||
if (engineConfiguration->isMapAveragingEnabled) {
|
if (engineConfiguration->isMapAveragingEnabled) {
|
||||||
initMapAveraging();
|
initMapAveraging(engine);
|
||||||
}
|
}
|
||||||
#endif /* EFI_MAP_AVERAGING */
|
#endif /* EFI_MAP_AVERAGING */
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ static msg_t mfiThread(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void initMalfunctionIndicator(void) {
|
void initMalfunctionIndicator(Engine *engine) {
|
||||||
// create static thread
|
// create static thread
|
||||||
chThdCreateStatic(mfiThreadStack, sizeof(mfiThreadStack), LOWPRIO, (tfunc_t) mfiThread, NULL);
|
chThdCreateStatic(mfiThreadStack, sizeof(mfiThreadStack), LOWPRIO, (tfunc_t) mfiThread, NULL);
|
||||||
// only for debug
|
// only for debug
|
|
@ -12,21 +12,12 @@
|
||||||
#define MALFUNCTION_INDICATOR_H_
|
#define MALFUNCTION_INDICATOR_H_
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "engine.h"
|
||||||
|
|
||||||
#if EFI_MALFUNCTIONAL_INDICATOR
|
#if EFI_MALFUNCTIONAL_INDICATOR
|
||||||
|
|
||||||
#ifdef __cplusplus
|
void initMalfunctionIndicator(Engine *engine);
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
void initMalfunctionIndicator(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#endif /* EFI_MALFUNCTIONAL_INDICATOR */
|
||||||
|
|
||||||
#endif /* MALFUNCTION_INDICATOR_H_ */
|
#endif /* MALFUNCTION_INDICATOR_H_ */
|
||||||
|
|
|
@ -124,7 +124,7 @@ static void endAveraging(void *arg) {
|
||||||
/**
|
/**
|
||||||
* Shaft Position callback used to schedule start and end of MAP averaging
|
* Shaft Position callback used to schedule start and end of MAP averaging
|
||||||
*/
|
*/
|
||||||
static void shaftPositionCallback(trigger_event_e ckpEventType, uint32_t index DECLARE_ENGINE_PARAMETER_S) {
|
static void mapAveragingCallback(trigger_event_e ckpEventType, uint32_t index DECLARE_ENGINE_PARAMETER_S) {
|
||||||
// this callback is invoked on interrupt thread
|
// this callback is invoked on interrupt thread
|
||||||
|
|
||||||
if (index != 0)
|
if (index != 0)
|
||||||
|
@ -170,7 +170,7 @@ float getMap(void) {
|
||||||
return getMapByVoltage(v_averagedMapValue);
|
return getMapByVoltage(v_averagedMapValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initMapAveraging(void) {
|
void initMapAveraging(Engine *engine) {
|
||||||
initLogging(&logger, "Map Averaging");
|
initLogging(&logger, "Map Averaging");
|
||||||
|
|
||||||
startTimer[0].name = "map start0";
|
startTimer[0].name = "map start0";
|
||||||
|
@ -178,7 +178,7 @@ void initMapAveraging(void) {
|
||||||
endTimer[0].name = "map end0";
|
endTimer[0].name = "map end0";
|
||||||
endTimer[1].name = "map end1";
|
endTimer[1].name = "map end1";
|
||||||
|
|
||||||
// addTriggerEventListener(&shaftPositionCallback, "rpm reporter", NULL);
|
addTriggerEventListener(&mapAveragingCallback, "MAP averaging", engine);
|
||||||
addConsoleAction("faststat", showMapStats);
|
addConsoleAction("faststat", showMapStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,9 @@
|
||||||
#ifndef ADC_AVERAGING_H_
|
#ifndef ADC_AVERAGING_H_
|
||||||
#define ADC_AVERAGING_H_
|
#define ADC_AVERAGING_H_
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#include "engine.h"
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
void mapAveragingCallback(adcsample_t newValue);
|
void mapAveragingCallback(adcsample_t newValue);
|
||||||
void initMapAveraging(void);
|
void initMapAveraging(Engine *engine);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* ADC_AVERAGING_H_ */
|
#endif /* ADC_AVERAGING_H_ */
|
||||||
|
|
|
@ -2185,7 +2185,7 @@
|
||||||
<name>$PROJ_DIR$\..\controllers\algo\main_trigger_callback.h</name>
|
<name>$PROJ_DIR$\..\controllers\algo\main_trigger_callback.h</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\controllers\algo\malfunction_central.c</name>
|
<name>$PROJ_DIR$\..\controllers\algo\malfunction_central.cpp</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\controllers\algo\malfunction_central.h</name>
|
<name>$PROJ_DIR$\..\controllers\algo\malfunction_central.h</name>
|
||||||
|
|
Loading…
Reference in New Issue