auto-sync

This commit is contained in:
rusEfi 2016-09-22 09:03:20 -04:00
parent 60e4fdaeb3
commit ffd917e653
3 changed files with 23 additions and 6 deletions

View File

@ -115,7 +115,7 @@ extern LoggingWithStorage sharedLogger;
// todo: make these macro? kind of a penny optimization if compiler is not smart to inline
void seTurnPinHigh(InjectorOutputPin *output) {
// if (output->currentLogicValue == 1) {
if (output->currentLogicValue == 1) {
// if (output->cancelNextTurningInjectorOff) {
// // how comes AutoTest.testFordAspire ends up here?
// } else {
@ -123,10 +123,14 @@ void seTurnPinHigh(InjectorOutputPin *output) {
// * #299
// * this is another kind of overlap which happens in case of a small duty cycle after a large duty cycle
// */
#if EFI_SIMULATOR || defined(__DOXYGEN__)
printf("cancelNextTurningInjectorOff %s %d\r\n", output->name, (int)getTimeNowUs());
#endif /* EFI_SIMULATOR */
// 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,
@ -138,6 +142,9 @@ void seTurnPinHigh(InjectorOutputPin *output) {
// firmwareError("Already high");
#endif
#if EFI_SIMULATOR || defined(__DOXYGEN__)
printf("seTurnPinHigh %s %d\r\n", output->name, (int)getTimeNowUs());
#endif /* EFI_SIMULATOR */
turnPinHigh(output);
}
@ -153,9 +160,16 @@ void seTurnPinLow(InjectorOutputPin *output) {
*
*/
output->cancelNextTurningInjectorOff = false;
#if EFI_SIMULATOR || defined(__DOXYGEN__)
printf("was cancelled %s %d\r\n", output->name, (int)getTimeNowUs());
#endif /* EFI_SIMULATOR */
return;
}
#if FUEL_MATH_EXTREME_LOGGING || defined(__DOXYGEN__)
#if EFI_SIMULATOR || defined(__DOXYGEN__)
printf("seTurnPinLow %s %d\r\n", output->name, (int)getTimeNowUs());
#endif /* EFI_SIMULATOR */
#if FUEL_MATH_EXTREME_LOGGING || defined(__DOXYGEN__)
const char * w = output->currentLogicValue == false ? "err" : "";
scheduleMsg(&sharedLogger, "- %spin=%s eventIndex %d %d", w, output->name,
@ -176,9 +190,10 @@ void seScheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t
scheduleMsg(&sharedLogger, "schX %s", param->name);
#endif /* FUEL_MATH_EXTREME_LOGGING */
#if EFI_UNIT_TEST || defined(__DOXYGEN__)
printf("schB %s %d\r\n", param->name, time);
#endif /* EFI_UNIT_TEST */
#if EFI_SIMULATOR || EFI_UNIT_TEST || defined(__DOXYGEN__)
printf("schB %s %d\r\n", param->name, (int)time);
#endif /* EFI_SIMULATOR || EFI_UNIT_TEST */
scheduleByTime(prefix, scheduling, time, callback, param);
}

View File

@ -38,6 +38,7 @@ engine_pins_s::engine_pins_s() {
void InjectorOutputPin::reset() {
overlappingScheduleOffTime = 0;
cancelNextTurningInjectorOff = false;
overlappingCounter = 0;
// todo: this could be refactored by calling some super-reset method
currentLogicValue = INITIAL_PIN_STATE;
}

View File

@ -53,6 +53,7 @@ public:
void reset();
efitimeus_t overlappingScheduleOffTime;
bool cancelNextTurningInjectorOff;
int overlappingCounter;
};
class engine_pins_s {