auto-sync

This commit is contained in:
rusEfi 2016-09-24 01:02:43 -04:00
parent d9d7ffaeae
commit 557eadecfc
2 changed files with 7 additions and 1 deletions

View File

@ -44,8 +44,10 @@ bool EventQueue::insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t
#endif /* EFI_UNIT_TEST */
efiAssert(callback != NULL, "NULL callback", false);
// please note that simulator does not use this code at all - simulator uses signal_executor_sleep
if (scheduling->isScheduled) {
#if EFI_UNIT_TEST || EFI_SIMULATOR || defined(__DOXYGEN__)
#if EFI_UNIT_TEST || defined(__DOXYGEN__)
printf("Already scheduled was %d\r\n", (int)scheduling->momentX);
printf("Already scheduled now %d\r\n", (int)timeX);
#endif /* EFI_UNIT_TEST || EFI_SIMULATOR */
@ -163,6 +165,9 @@ int EventQueue::executeAll(efitime_t now) {
current->isScheduled = false;
int howFarOff = now - current->momentX;
maxHowFarOff = maxI(maxHowFarOff, howFarOff);
#if EFI_UNIT_TEST || defined(__DOXYGEN__)
printf("execute %d %d\r\n", (int)current, (int)current->param);
#endif
current->callback(current->param);
// even with overflow it's safe to subtract here
lastEventQueueTime = GET_TIMESTAMP() - before;

View File

@ -6,6 +6,7 @@
#include <time.h>
#include <math.h>
#include "efifeatures.h"
#include "rusefi_enums.h"
#include "auto_generated_enums.h"
#include "obd_error_codes.h"