auto-sync

This commit is contained in:
rusEfi 2014-11-15 20:03:56 -06:00
parent 1e2e49de20
commit 85141f8114
4 changed files with 31 additions and 2 deletions

View File

@ -109,8 +109,8 @@ void chDbgPanic3(const char *msg, const char * file, int line);
#define chDbgCheckClassI()
#define chDbgCheckClassS()
#else
#define dbg_enter_lock() (dbg_lock_cnt = 1)
#define dbg_leave_lock() (dbg_lock_cnt = 0)
#define dbg_enter_lock() {dbg_lock_cnt = 1;ON_LOCK_HOOK;}
#define dbg_leave_lock() {dbg_lock_cnt = 0;ON_UNLOCK_HOOK;}
#endif
/*===========================================================================*/

View File

@ -257,6 +257,7 @@ static void setMiata1994_common(engine_configuration_s *engineConfiguration, boa
// Frankenso low out #11: PB8
// Frankenso low out #12: PB7
boardConfiguration->fanPin = GPIOE_6;
boardConfiguration->o2heaterPin = GPIO_UNASSIGNED;

View File

@ -52,6 +52,20 @@
#define CHPRINTF_USE_FLOAT TRUE
#define EFI_CLOCK_LOCKS TRUE
#if EFI_CLOCK_LOCKS
void onLockHook(void);
void onUnlockHook(void);
#define ON_LOCK_HOOK onLockHook()
#define ON_UNLOCK_HOOK onUnlockHook()
#else /* EFI_CLOCK_LOCKS */
#define ON_LOCK_HOOK
#define ON_UNLOCK_HOOK
#endif /* EFI_CLOCK_LOCKS */
/**
* number of ticks per second
*

View File

@ -87,6 +87,20 @@ char *getWarninig(void) {
return warningBuffer;
}
uint64_t lastLockTime;
uint64_t maxLockTime = 0;
void onLockHook(void) {
lastLockTime = getTimeNowNt();
}
void onUnlockHook(void) {
uint64_t t = getTimeNowNt() - lastLockTime;
if (t > maxLockTime) {
maxLockTime = t;
}
}
void initErrorHandling(void) {
initLogging(&logger, "error handling");
msObjectInit(&warningStream, (uint8_t *) warningBuffer, WARNING_BUFFER_SIZE, 0);