auto-sync

This commit is contained in:
rusEfi 2015-02-02 07:06:40 -06:00
parent 92e9c1d86d
commit 32003658be
6 changed files with 20 additions and 11 deletions

View File

@ -101,6 +101,11 @@ int TriggerCentral::getHwEventCounter(int index) {
return hwEventCounters[index];
}
void TriggerCentral::resetCounters() {
memset(hwEventCounters, 0, sizeof(hwEventCounters));
triggerState.resetRunningCounters();
}
static char shaft_signal_msg_index[15];
static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType, int index) {
@ -298,7 +303,8 @@ float getTriggerDutyCycle(int index) {
}
static void resetRunningTriggerCounters() {
triggerCentral.triggerState.resetRunningCounters();
triggerCentral.resetCounters();
triggerInfo(engine);
}
void initTriggerCentral(Logging *sharedLogger, Engine *engine) {

View File

@ -26,6 +26,7 @@ public:
void addEventListener(ShaftPositionListener handler, const char *name, Engine *engine);
void handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PARAMETER_S);
int getHwEventCounter(int index);
void resetCounters();
TriggerState triggerState;
uint64_t nowNt;
private:

View File

@ -227,24 +227,24 @@ void chDbgStackOverflowPanic(Thread *otp) {
extern engine_pins_s enginePins;
// todo: why is this method here and not in error_handling.c ?
void firmwareError(const char *fmt, ...) {
void firmwareError(const char *errorMsg, ...) {
if (hasFirmwareErrorFlag)
return;
enginePins.errorLedPin.setValue(1);
turnAllPinsOff();
hasFirmwareErrorFlag = TRUE;
if (indexOf(fmt, '%') == -1) {
if (indexOf(errorMsg, '%') == -1) {
/**
* in case of simple error message let's reduce stack usage
* because chvprintf might be causing an error
*/
strcpy((char*) errorMessageBuffer, fmt);
strcpy((char*) errorMessageBuffer, errorMsg);
} else {
firmwareErrorMessageStream.eos = 0; // reset
va_list ap;
va_start(ap, fmt);
chvprintf((BaseSequentialStream *) &firmwareErrorMessageStream, fmt, ap);
va_start(ap, errorMsg);
chvprintf((BaseSequentialStream *) &firmwareErrorMessageStream, errorMsg, ap);
va_end(ap);
firmwareErrorMessageStream.buffer[firmwareErrorMessageStream.eos] = 0; // need to terminate explicitly
@ -260,5 +260,5 @@ int getRusEfiVersion(void) {
return 1; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE == 0)
return 1; // this is here to make the compiler happy about the unused array
return 20150201;
return 20150202;
}

View File

@ -243,9 +243,9 @@ float injectionAngle;this is about deciding when the injector starts it's squirt
float diffLoadEnrichmentCoef;
air_pressure_sensor_config_s baroSensor;@see hasBaroSensor
float[FUEL_LOAD_COUNT] veLoadBins;;1, 0.0, 0, 300.0, 2
float[FUEL_LOAD_COUNT] veLoadBins;;"%", 1, 0.0, 0, 300.0, 2
float[FUEL_RPM_COUNT] veRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
float[FUEL_LOAD_COUNT] afrLoadBins;;1, 0.0, 0, 300.0, 2
float[FUEL_LOAD_COUNT] afrLoadBins;;"%", 1, 0.0, 0, 300.0, 2
float[FUEL_RPM_COUNT] afrRpmBins;;"RPM", 1, 0.0, 0, 18000.0, 2
fuel_table_t fuelTable;

View File

@ -151,9 +151,9 @@ enable2ndByteCanID = false
baroSensor_valueAt5 = scalar, F32, 1112, "kpa", 1, 0, 0, 450, 2
baroSensor_type = bits, U32, 1116, [0:1] "Custom", "DENSO183", "MPX4250", "INVALID"
baroSensor_hwChannel = bits, U32, 1120, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
veLoadBins = array, F32, 1124, [16], 1, 0.0, 0, 300.0, 2
veLoadBins = array, F32, 1124, [16], "%", 1, 0.0, 0, 300.0, 2
veRpmBins = array, F32, 1188, [16], "RPM", 1, 0.0, 0, 18000.0, 2
afrLoadBins = array, F32, 1252, [16], 1, 0.0, 0, 300.0, 2
afrLoadBins = array, F32, 1252, [16], "%", 1, 0.0, 0, 300.0, 2
afrRpmBins = array, F32, 1316, [16], "RPM", 1, 0.0, 0, 18000.0, 2
fuelTable = array, F32, 1380, [16x16],"ms", 1, 0, 0.0, 300.0, 2
ignitionTable = array, F32, 2404, [16x16],"deg", 1, 0, -360, 360, 2

View File

@ -56,6 +56,8 @@ public class RecentCommands {
add("enable self_stimulation");
add("disable self_stimulation");
add("sparkbench 5 400 2");
add("fuelbench 5 400 2");
add("fuelpumpbench");
add("fanbench");
add("milbench");