wider usage of EFI_CLOCK_LOCKS

This commit is contained in:
rusefi 2017-05-21 10:46:43 -04:00
parent 4750d49844
commit 2e70da24db
3 changed files with 17 additions and 4 deletions

View File

@ -113,9 +113,9 @@ bool warning(obd_code_e code, const char *fmt, ...) {
#if EFI_SIMULATOR || defined(__DOXYGEN__)
printf("sim_warning %s\r\n", fmt);
#endif
#endif /* EFI_SIMULATOR */
#if EFI_SIMULATOR || EFI_PROD_CODE
#if EFI_SIMULATOR || EFI_PROD_CODE || defined(__DOXYGEN__)
efiAssert(isWarningStreamInitialized, "warn stream not initialized", false);
addWarningCode(code);
@ -146,7 +146,7 @@ bool warning(obd_code_e code, const char *fmt, ...) {
va_end(ap);
printf("\r\n");
#endif
#endif /* EFI_SIMULATOR || EFI_PROD_CODE */
return false;
}
@ -154,6 +154,8 @@ char *getWarning(void) {
return warningBuffer;
}
#if EFI_CLOCK_LOCKS || defined(__DOXYGEN__)
uint32_t lastLockTime;
/**
* Maximum time before requesting lock and releasing lock at the end of critical section
@ -175,6 +177,9 @@ void onUnlockHook(void) {
// }
}
#endif /* EFI_CLOCK_LOCKS */
void initErrorHandling(void) {
#if EFI_SIMULATOR || EFI_PROD_CODE || defined(__DOXYGEN__)
msObjectInit(&warningStream, (uint8_t *) warningBuffer, WARNING_BUFFER_SIZE, 0);

View File

@ -406,7 +406,10 @@ void resetMaxValues() {
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
maxEventCallbackDuration = triggerMaxDuration = 0;
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
#if EFI_CLOCK_LOCKS || defined(__DOXYGEN__)
maxLockedDuration = 0;
#endif /* EFI_CLOCK_LOCKS */
#if (EFI_PROD_CODE) || defined(__DOXYGEN__)
maxPrecisionCallbackDuration = 0;
@ -503,7 +506,10 @@ void triggerInfo(void) {
engine->m.rpmCbTime,
engine->m.mainTriggerCallbackTime);
#if EFI_CLOCK_LOCKS || defined(__DOXYGEN__)
scheduleMsg(logger, "maxLockedDuration=%d / maxTriggerReentraint=%d", maxLockedDuration, maxTriggerReentraint);
#endif /* EFI_CLOCK_LOCKS */
scheduleMsg(logger, "maxEventCallbackDuration=%d", maxEventCallbackDuration);
scheduleMsg(logger, "hipLastExecutionCount=%d", hipLastExecutionCount);

View File

@ -114,7 +114,9 @@ static void printStatus(void) {
static void setChartActive(int value) {
engineConfiguration->isEngineChartEnabled = value;
printStatus();
maxLockedDuration = 0;
#if EFI_CLOCK_LOCKS || defined(__DOXYGEN__)
maxLockedDuration = 0; // todo: why do we reset this here? why only this and not all metrics?
#endif /* EFI_CLOCK_LOCKS */
}
void setChartSize(int newSize) {