auto-sync

This commit is contained in:
rusEfi 2015-01-14 20:03:44 -06:00
parent 4149e6d2d3
commit 0db6580011
8 changed files with 15 additions and 20 deletions

View File

@ -378,7 +378,7 @@ void initEngineContoller(Logging *sharedLogger, Engine *engine) {
#if EFI_MAP_AVERAGING || defined(__DOXYGEN__)
if (engineConfiguration->isMapAveragingEnabled) {
initMapAveraging(engine);
initMapAveraging(sharedLogger, engine);
}
#endif /* EFI_MAP_AVERAGING */

View File

@ -39,7 +39,7 @@
#define FAST_MAP_CHART_SKIP_FACTOR 16
static LoggingWithStorage logger;
static Logging *logger;
/**
* Running counter of measurements per revolution
@ -153,7 +153,7 @@ static void mapAveragingCallback(trigger_event_e ckpEventType, uint32_t index DE
}
static void showMapStats(void) {
scheduleMsg(&logger, "per revolution %d", perRevolution);
scheduleMsg(logger, "per revolution %d", perRevolution);
}
float getMapVoltage(void) {
@ -170,8 +170,8 @@ float getMap(void) {
return getMapByVoltage(v_averagedMapValue);
}
void initMapAveraging(Engine *engine) {
initLogging(&logger, "Map Averaging");
void initMapAveraging(Logging *sharedLogger, Engine *engine) {
logger = sharedLogger;
startTimer[0].name = "map start0";
startTimer[1].name = "map start1";

View File

@ -13,7 +13,7 @@
#if HAL_USE_ADC || defined(__DOXYGEN__)
void mapAveragingCallback(adcsample_t newValue);
void initMapAveraging(Engine *engine);
void initMapAveraging(Logging *sharedLogger, Engine *engine);
#endif

View File

@ -37,7 +37,7 @@ extern WaveChart waveChart;
EXTERN_ENGINE;
static LoggingWithStorage logger;
static Logging * logger;
RpmCalculator::RpmCalculator() {
#if !EFI_PROD_CODE
@ -223,7 +223,6 @@ float getCrankshaftAngleNt(uint64_t timeNt DECLARE_ENGINE_PARAMETER_S) {
void initRpmCalculator(Engine *engine) {
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
initLogging(&logger, "rpm calc");
tdcScheduler[0].name = "tdc0";
tdcScheduler[1].name = "tdc1";

View File

@ -50,9 +50,7 @@ bool printGapRatio = false;
float actualSynchGap;
#endif /* ! EFI_PROD_CODE */
#if (EFI_PROD_CODE || EFI_SIMULATOR)
static LoggingWithStorage logger;
#endif
static Logging * logger;
/**
* @return TRUE is something is wrong with trigger decoding
@ -170,7 +168,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, uint64_t now
#endif /* EFI_PROD_CODE */
float gap = 1.0 * currentDuration / toothed_previous_duration;
#if EFI_PROD_CODE
scheduleMsg(&logger, "gap=%f @ %d", gap, current_index);
scheduleMsg(logger, "gap=%f @ %d", gap, current_index);
#else
actualSynchGap = gap;
print("current gap %f\r\n", gap);
@ -198,7 +196,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, uint64_t now
totalTriggerErrorCounter++;
if (engineConfiguration->isPrintTriggerSynchDetails) {
#if EFI_PROD_CODE
scheduleMsg(&logger, "error: synchronizationPoint @ index %d expected %d/%d/%d got %d/%d/%d", current_index,
scheduleMsg(logger, "error: synchronizationPoint @ index %d expected %d/%d/%d got %d/%d/%d", current_index,
TRIGGER_SHAPE(expectedEventCount[0]), TRIGGER_SHAPE(expectedEventCount[1]),
TRIGGER_SHAPE(expectedEventCount[2]), eventCount[0], eventCount[1], eventCount[2]);
#endif /* EFI_PROD_CODE */
@ -444,10 +442,8 @@ uint32_t findTriggerZeroEventIndex(TriggerShape * shape, trigger_config_s const*
//static Logging logger;
#endif
void initTriggerDecoderLogger(void) {
#if (EFI_PROD_CODE || EFI_SIMULATOR)
initLogging(&logger, "trigger decoder");
#endif
void initTriggerDecoderLogger(Logging *sharedLogger) {
logger = sharedLogger;
}
void initTriggerDecoder(void) {

View File

@ -90,7 +90,7 @@ class Engine;
void initializeTriggerShape(Logging *logger, engine_configuration_s const *engineConfiguration, Engine *engine);
void initTriggerDecoder(void);
void initTriggerDecoderLogger(void);
void initTriggerDecoderLogger(Logging *sharedLogger);
bool_t isTriggerDecoderError(void);

View File

@ -184,7 +184,7 @@ void initHardware(Logging *l, Engine *engine) {
* which would be used while finding trigger synch index
* while config read
*/
initTriggerDecoderLogger();
initTriggerDecoderLogger(sharedLogger);
/**
* We need the LED_ERROR pin even before we read configuration

View File

@ -253,7 +253,7 @@ void firmwareError(const char *fmt, ...) {
}
}
static char UNUSED_RAM_SIZE[5500];
static char UNUSED_RAM_SIZE[6000];
static char UNUSED_CCM_SIZE[8000] CCM_OPTIONAL;