auto-sync

This commit is contained in:
rusEfi 2014-11-24 13:03:17 -06:00
parent 740eec2bd1
commit 6b9516b434
6 changed files with 8 additions and 15 deletions

View File

@ -573,9 +573,8 @@ engine_configuration2_s::engine_configuration2_s() {
}
void engine_configuration2_s::precalc() {
//sparkTable.init()
//engineConfiguration->sparkDwellBins, engineConfiguration->sparkDwell, DWELL_CURVE_SIZE);
sparkTable.init(DWELL_CURVE_SIZE, sparkAtable, sparkBtable);
sparkTable.preCalc(engineConfiguration->sparkDwellBins, engineConfiguration->sparkDwell);
}
void applyNonPersistentConfiguration(Logging * logger, Engine *engine) {

View File

@ -127,7 +127,7 @@ void scheduleOutput(OutputSignal *signal, float delayMs, float durationMs) {
scheduling_s * sDown = &signal->signalTimerDown[index];
scheduleTask("out up", sUp, (int) MS2US(delayMs), (schfunc_t) &turnPinHigh, (void *) signal->io_pin);
scheduleTask("out down", sDown, (int) MS2US(delayMs + durationMs), (schfunc_t) &turnPinLow, (void*) signal->io_pin);
scheduleTask("out down", sDown, (int) MS2US(delayMs) + MS2US(durationMs), (schfunc_t) &turnPinLow, (void*) signal->io_pin);
}
io_pin_e getPinByName(const char *name) {

View File

@ -27,6 +27,7 @@ void Table2D::init(int size, float *aTable, float *bTable) {
}
void Table2D::preCalc(float *bin, float *values) {
this->bin = bin;
for (int i = 0; i < size - 1; i++) {
float x1 = bin[i];
float x2 = bin[i + 1];

View File

@ -32,6 +32,7 @@ public:
int size;
float *aTable;
float *bTable;
float *bin;
};
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>

View File

@ -34,15 +34,10 @@ extern "C"
float fixAngle(float angle DECLARE_ENGINE_PARAMETER_S);
/**
* So that's how 'inline' syntax for both GCC and IAR
* It is interesting to mention that GCC compiler chooses not to inline this function.
*
* @return time needed to rotate crankshaft by one degree, in milliseconds.
* @deprecated use at least Us, maybe event Nt
* @deprecated use at least Us, maybe even Nt
*/
inline float getOneDegreeTimeMs(int rpm) {
return 1000.0f * 60 / 360 / rpm;
}
#define getOneDegreeTimeMs(rpm) (1000.0f * 60 / 360 / (rpm))
/**
* @return time needed to rotate crankshaft by one degree, in microseconds.

View File

@ -117,9 +117,6 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(InjectionEvent *event, int rp
float delayMs = getOneDegreeTimeMs(rpm) * event->position.angleOffset;
// if (isCranking())
// scheduleMsg(&logger, "crankingFuel=%f for CLT=%fC", fuelMs, getCoolantTemperature());
if (event->isSimultanious) {
if (fuelMs < 0) {
firmwareError("duration cannot be negative: %d", fuelMs);
@ -141,7 +138,7 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(InjectionEvent *event, int rp
scheduling_s * sDown = &signal->signalTimerDown[index];
scheduleTask("out up", sUp, (int) MS2US(delayMs), (schfunc_t) &startSimultaniousInjection, engine);
scheduleTask("out down", sDown, (int) MS2US(delayMs + fuelMs), (schfunc_t) &endSimultaniousInjection, engine);
scheduleTask("out down", sDown, (int) MS2US(delayMs) + MS2US(fuelMs), (schfunc_t) &endSimultaniousInjection, engine);
} else {
scheduleOutput(event->actuator, delayMs, fuelMs);