auto-sync

This commit is contained in:
rusEfi 2014-11-07 19:04:58 -06:00
parent f209d30f13
commit 473c0bda3a
5 changed files with 26 additions and 18 deletions

View File

@ -114,7 +114,7 @@ static void vappendPrintfI(Logging *logging, const char *fmt, va_list arg) {
} }
void vappendPrintf(Logging *logging, const char *fmt, va_list arg) { void vappendPrintf(Logging *logging, const char *fmt, va_list arg) {
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#5b"); efiAssertVoid(getRemainingStack(chThdSelf()) > 64, "lowstck#5b");
if (!intermediateLoggingBufferInited) { if (!intermediateLoggingBufferInited) {
firmwareError("intermediateLoggingBufferInited not inited!"); firmwareError("intermediateLoggingBufferInited not inited!");
return; return;
@ -141,7 +141,7 @@ void vappendPrintf(Logging *logging, const char *fmt, va_list arg) {
} }
void appendPrintf(Logging *logging, const char *fmt, ...) { void appendPrintf(Logging *logging, const char *fmt, ...) {
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#4"); efiAssertVoid(getRemainingStack(chThdSelf()) > 32, "lowstck#4");
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
vappendPrintf(logging, fmt, ap); vappendPrintf(logging, fmt, ap);

View File

@ -176,7 +176,7 @@ void WaveChart::addWaveChartEvent3(const char *name, const char * msg, const cha
* at least that's 32 bit division now * at least that's 32 bit division now
*/ */
uint32_t diffNt = nowNt - startTimeNt; uint32_t diffNt = nowNt - startTimeNt;
uint32_t time100 = diffNt / 10 / 168; uint32_t time100 = NT2US(diffNt / 10);
if (remainingSize(&logging) > 30) { if (remainingSize(&logging) > 30) {

View File

@ -180,7 +180,18 @@ void FuelSchedule::registerInjectionEvent(engine_configuration_s const *e, trigg
warning(OBD_PCM_Processor_Fault, "pin not assigned for injector #%d", (int) pin - (int) INJECTOR_1_OUTPUT + 1); warning(OBD_PCM_Processor_Fault, "pin not assigned for injector #%d", (int) pin - (int) INJECTOR_1_OUTPUT + 1);
} }
registerActuatorEventExt(e, s, list->getNextActuatorEvent(), injectonSignals.add(pin), angle); ActuatorEvent *ev = list->getNextActuatorEvent();
OutputSignal *actuator = injectonSignals.add(pin);
efiAssertVoid(s->getSize() > 0, "uninitialized trigger_shape_s");
if (ev == NULL) {
// error already reported
return;
}
ev->actuator = actuator;
registerActuatorEventExt(e, s, ev, actuator, angle);
} }
void FuelSchedule::addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s, void FuelSchedule::addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s,
@ -304,17 +315,11 @@ void findTriggerPosition(engine_configuration_s const *engineConfiguration, trig
position->angleOffset = angleOffset - eventAngle; position->angleOffset = angleOffset - eventAngle;
} }
void registerActuatorEventExt(engine_configuration_s const *engineConfiguration, trigger_shape_s * s, ActuatorEvent *e, void registerActuatorEventExt(engine_configuration_s const *e, trigger_shape_s * s, ActuatorEvent *ev,
OutputSignal *actuator, float angleOffset) { OutputSignal *actuator, float angle) {
efiAssertVoid(s->getSize() > 0, "uninitialized trigger_shape_s");
if (e == NULL) {
// error already reported
return;
}
e->actuator = actuator;
findTriggerPosition(engineConfiguration, s, &e->position, angleOffset); findTriggerPosition(e, s, &ev->position, angle);
} }
static int order_1_THEN_3_THEN_4_THEN2[] = { 1, 3, 4, 2 }; static int order_1_THEN_3_THEN_4_THEN2[] = { 1, 3, 4, 2 };

View File

@ -104,7 +104,7 @@ static void handleFuelInjectionEvent(MainTriggerCallback *mainTriggerCallback, A
static void handleFuel(Engine *engine, MainTriggerCallback *mainTriggerCallback, uint32_t eventIndex, int rpm) { static void handleFuel(Engine *engine, MainTriggerCallback *mainTriggerCallback, uint32_t eventIndex, int rpm) {
if (!isInjectionEnabled(mainTriggerCallback->engineConfiguration)) if (!isInjectionEnabled(mainTriggerCallback->engineConfiguration))
return; return;
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#3"); efiAssertVoid(getRemainingStack(chThdSelf()) > 64, "lowstck#3");
efiAssertVoid(eventIndex < mainTriggerCallback->engineConfiguration2->triggerShape.getLength(), "event index"); efiAssertVoid(eventIndex < mainTriggerCallback->engineConfiguration2->triggerShape.getLength(), "event index");
engine_configuration_s *engineConfiguration = engine->engineConfiguration; engine_configuration_s *engineConfiguration = engine->engineConfiguration;
@ -112,10 +112,12 @@ static void handleFuel(Engine *engine, MainTriggerCallback *mainTriggerCallback,
* Ignition events are defined by addFuelEvents() according to selected * Ignition events are defined by addFuelEvents() according to selected
* fueling strategy * fueling strategy
*/ */
ActuatorEventList *source = FuelSchedule *fs =
isCrankingR(rpm) ? isCrankingR(rpm) ?
&mainTriggerCallback->engineConfiguration2->crankingInjectionEvents.events : &mainTriggerCallback->engineConfiguration2->crankingInjectionEvents :
&mainTriggerCallback->engineConfiguration2->injectionEvents.events; &mainTriggerCallback->engineConfiguration2->injectionEvents;
ActuatorEventList *source = &fs->events;
for (int i = 0; i < source->size; i++) { for (int i = 0; i < source->size; i++) {
ActuatorEvent *event = &source->events[i]; ActuatorEvent *event = &source->events[i];
@ -244,7 +246,7 @@ void onTriggerEvent(trigger_event_e ckpSignalType, uint32_t eventIndex, MainTrig
(void) ckpSignalType; (void) ckpSignalType;
efiAssertVoid(eventIndex < 2 * mainTriggerCallback->engineConfiguration2->triggerShape.shaftPositionEventCount, efiAssertVoid(eventIndex < 2 * mainTriggerCallback->engineConfiguration2->triggerShape.shaftPositionEventCount,
"event index"); "event index");
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#3"); efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#2");
// todo int rpm = getRpmE(mainTriggerCallback->engine); // todo int rpm = getRpmE(mainTriggerCallback->engine);
int rpm = getRpmE(&engine); int rpm = getRpmE(&engine);

View File

@ -61,6 +61,7 @@ void addTriggerEventListener(ShaftPositionListener listener, const char *name, v
extern Engine engine; extern Engine engine;
void hwHandleShaftSignal(trigger_event_e signal) { void hwHandleShaftSignal(trigger_event_e signal) {
efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#8");
triggerCentral.handleShaftSignal(&engine, signal); triggerCentral.handleShaftSignal(&engine, signal);
} }
#endif /* EFI_PROD_CODE */ #endif /* EFI_PROD_CODE */