auto-sync

This commit is contained in:
rusEfi 2015-04-27 12:09:32 -04:00
parent 7b43e57f93
commit 2423318fa2
3 changed files with 12 additions and 4 deletions

View File

@ -85,13 +85,14 @@ typedef struct {
unsigned int isMapError : 1; // bit 2 unsigned int isMapError : 1; // bit 2
unsigned int isIatError : 1; // bit 3 unsigned int isIatError : 1; // bit 3
unsigned int isAcSwitchEngaged : 1; // bit 4 unsigned int isAcSwitchEngaged : 1; // bit 4
unsigned int isTriggerError : 1; // bit 5
int tsConfigVersion; int tsConfigVersion;
egt_values_s egtValues; egt_values_s egtValues;
float rpmAcceleration; float rpmAcceleration;
float massAirFlowValue; float massAirFlowValue;
float veValue; float veValue;
float deltaTps; float deltaTps;
float unused120; int triggerErrorsCounter;
float currentMapAccelDelta; float currentMapAccelDelta;
float tpsAccelFuel; float tpsAccelFuel;
int unused3[16]; int unused3[16];

View File

@ -476,6 +476,11 @@ static void setBlinkingPeriod(int value) {
extern efitick_t lastDecodingErrorTime; extern efitick_t lastDecodingErrorTime;
static bool_t isTriggerErrorNow() {
bool_t justHadError = (getTimeNowNt() - lastDecodingErrorTime) < US2NT(2 * 1000 * 3 * blinkingPeriod);
return justHadError || isTriggerDecoderError();
}
/** /**
* this thread has a lower-then-usual stack size so we cannot afford *print* methods here * this thread has a lower-then-usual stack size so we cannot afford *print* methods here
*/ */
@ -500,8 +505,7 @@ static void blinkingThread(void *arg) {
communicationPin.setValue(1); communicationPin.setValue(1);
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) #if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
bool_t justHadError = (getTimeNowNt() - lastDecodingErrorTime) < US2NT(2 * 1000 * delayMs); if (isTriggerErrorNow() || isIgnitionTimingError())
if (justHadError || isTriggerDecoderError() || isIgnitionTimingError())
warningPin.setValue(1); warningPin.setValue(1);
#endif #endif
chThdSleepMilliseconds(delayMs); chThdSleepMilliseconds(delayMs);
@ -563,10 +567,11 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->currentMapAccelDelta = engine->mapAccelEnrichment.getMapEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap(); tsOutputChannels->currentMapAccelDelta = engine->mapAccelEnrichment.getMapEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap();
tsOutputChannels->tpsAccelFuel = engine->tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_F); tsOutputChannels->tpsAccelFuel = engine->tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_F);
tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getDelta(); tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getDelta();
tsOutputChannels->triggerErrorsCounter = triggerCentral.triggerState.totalTriggerErrorCounter;
tsOutputChannels->checkEngine = hasErrorCodes(); tsOutputChannels->checkEngine = hasErrorCodes();
#if EFI_PROD_CODE || defined(__DOXYGEN__) #if EFI_PROD_CODE || defined(__DOXYGEN__)
tsOutputChannels->isTriggerError = isTriggerErrorNow();
#if EFI_MAX_31855 || defined(__DOXYGEN__) #if EFI_MAX_31855 || defined(__DOXYGEN__)
for (int i = 0; i < EGT_CHANNEL_COUNT; i++) for (int i = 0; i < EGT_CHANNEL_COUNT; i++)

View File

@ -46,6 +46,8 @@ static void speedInfo(void) {
engineConfiguration->vehicleSpeedCoef, engineConfiguration->vehicleSpeedCoef,
vssCounter, vssCounter,
getVehicleSpeed()); getVehicleSpeed());
scheduleMsg(logger, "vss diff %d", vssDiff);
} }
void initVehicleSpeed(Logging *l) { void initVehicleSpeed(Logging *l) {