auto-sync

This commit is contained in:
rusEfi 2016-09-12 20:02:56 -04:00
parent aa2507a5ac
commit a8de570ead
4 changed files with 20 additions and 13 deletions

View File

@ -114,7 +114,15 @@ extern LoggingWithStorage sharedLogger;
#endif /* FUEL_MATH_EXTREME_LOGGING */
// todo: make these macro? kind of a penny optimization if compiler is not smart to inline
void seTurnPinHigh(NamedOutputPin *output) {
void seTurnPinHigh(InjectorOutputPin *output) {
if (output->currentLogicValue == 1) {
/**
* #299
* this is another kind of overlap which happens in case of a small duty cycle after a large duty cycle
*/
output->cancelNextTurningInjectorOff = true;
return;
}
#if FUEL_MATH_EXTREME_LOGGING || defined(__DOXYGEN__)
const char * w = output->currentLogicValue == true ? "err" : "";
scheduleMsg(&sharedLogger, "^ %spin=%s eventIndex %d %d", w, output->name,
@ -122,8 +130,8 @@ void seTurnPinHigh(NamedOutputPin *output) {
#endif /* FUEL_MATH_EXTREME_LOGGING */
#if EFI_UNIT_TEST
// if (output->currentLogicValue == 1)
// firmwareError("Already high");
if (output->currentLogicValue == 1)
firmwareError("Already high");
#endif
turnPinHigh(output);
@ -151,8 +159,8 @@ void seTurnPinLow(InjectorOutputPin *output) {
#endif /* FUEL_MATH_EXTREME_LOGGING */
#if EFI_UNIT_TEST
// if (output->currentLogicValue == 0)
// firmwareError("Already low");
if (output->currentLogicValue == 0)
firmwareError("Already low");
#endif
turnPinLow(output);

View File

@ -125,6 +125,9 @@ static void applyAlternatorPinState(PwmConfig *state, int stateIndex) {
efiAssertVoid(state->multiWave.waveCount == 1, "invalid idle waveCount");
OutputPin *output = state->outputPins[0];
int value = state->multiWave.waves[0].pinStates[stateIndex];
/**
* 'engine->isAlternatorControlEnabled' would be false is RPM is too low
*/
if (!value || engine->isAlternatorControlEnabled)
output->setValue(value);
}

View File

@ -139,7 +139,7 @@ public:
void outputPinRegisterExt2(const char *msg, OutputPin *output, brain_pin_e brainPin, pin_output_mode_e *outputMode);
void seTurnPinHigh(NamedOutputPin *output);
void seTurnPinHigh(InjectorOutputPin *output);
void seTurnPinLow(InjectorOutputPin *output);
void turnPinHigh(NamedOutputPin *output);
void turnPinLow(NamedOutputPin *output);

View File

@ -909,7 +909,7 @@ void testFuelSchedulerBug299smallAndMedium(void) {
assertEqualsM("Queue.size#03", 9, schedulingQueue.size());
engine->periodicFastCallback(PASS_ENGINE_PARAMETER_F);
assertInjectorUpEvent("07@0", 0, MS2US(7.5), 1);
// todo index 1
assertInjectorDownEvent("07@1", 1, MS2US(10), 0);
assertInjectorUpEvent("07@2", 2, MS2US(17.5), 0);
assertInjectorDownEvent("07@3", 3, MS2US(20), 1);
assertInjectorUpEvent("07@4", 4, MS2US(27.5), 1);
@ -982,7 +982,6 @@ void testFuelSchedulerBug299smallAndMedium(void) {
assertInjectionEvent("#4", &t->injectionEvents.elements[3], 1, 0, 45, false);
// todo: what's what? a mix of new something and old something?
assertEqualsM("qs#5", 10, schedulingQueue.size());
assertInjectorDownEvent("8@0", 0, MS2US(5.0), 1);
assertInjectorUpEvent("8@1", 1, MS2US(7.5), 1);
@ -992,8 +991,8 @@ void testFuelSchedulerBug299smallAndMedium(void) {
assertInjectorUpEvent("8@5", 5, MS2US(27.5), 1);
assertInjectorDownEvent("8@6", 6, MS2US(35), 0);
assertInjectorUpEvent("8@7", 7, MS2US(37.5), 0);
// todo index 8 9
assertInjectorDownEvent("8@8", 8, MS2US(45), 1);
assertInjectorDownEvent("8@9", 9, MS2US(55), 0);
schedulingQueue.executeAll(timeNow);
@ -1009,9 +1008,6 @@ void testFuelSchedulerBug299smallAndLarge(void) {
setTestBug299(&eth);
assertEqualsM("Lqs#0", 4, schedulingQueue.size());
FuelSchedule * t;
int engineLoadIndex = findIndex(config->fuelLoadBins, FUEL_LOAD_COUNT, testMafValue);
assertEquals(8, engineLoadIndex);
setArrayValues(fuelMap.pointers[engineLoadIndex], FUEL_RPM_COUNT, 35);