From 3358cdab11b81f6515ccfa736b0dd14285240f00 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 13 Sep 2022 11:07:25 -0700 Subject: [PATCH] resurrect EFI_CLOCK_LOCKS (#4572) * resurrect EFI_CLOCK_LOCKS * missing extern Co-authored-by: Matthew Kennedy --- firmware/config/stm32f4ems/efifeatures.h | 2 ++ firmware/console/binary/output_channels.txt | 4 ++-- firmware/console/status_loop.cpp | 2 +- firmware/controllers/algo/runtime_state.cpp | 8 ++------ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index d1534c1ec0..ef1ed2a366 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -60,6 +60,8 @@ #define EFI_ENABLE_ASSERTS TRUE #endif /* EFI_ENABLE_ASSERTS */ +#define EFI_CLOCK_LOCKS TRUE + //#define EFI_UART_ECHO_TEST_MODE TRUE /** diff --git a/firmware/console/binary/output_channels.txt b/firmware/console/binary/output_channels.txt index eaf7eb1e5c..b1e8973065 100644 --- a/firmware/console/binary/output_channels.txt +++ b/firmware/console/binary/output_channels.txt @@ -302,8 +302,8 @@ uint16_t rpmAcceleration;dRPM;"RPM/s",1, 0, 0, 5, 0 uint16_t mostRecentTimeBetweenSparkEvents;;"", 1, 0, -10000, 10000, 3 uint16_t mostRecentTimeBetweenIgnitionEvents;;"", 1, 0, -10000, 10000, 3 - uint16_t maxLockedDuration;;"", 1, 0, -10000, 10000, 3 - uint16_t maxTriggerReentrant;;"", 1, 0, -10000, 10000, 3 + uint16_t maxLockedDuration;;"us", 1, 0, 0, 65535, 0 + uint8_t maxTriggerReentrant;;"", 1, 0, 0, 100, 0 uint16_t canWriteOk;;"", 1, 0, -10000, 10000, 3 uint16_t canWriteNotOk;;"", 1, 0, -10000, 10000, 3 diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 249f7c1fdc..997d02dd3b 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -804,7 +804,7 @@ void updateTunerStudioState() { #endif /* EFI_CAN_SUPPORT */ #if EFI_CLOCK_LOCKS - tsOutputChannels->maxLockedDuration = maxLockedDuration; + tsOutputChannels->maxLockedDuration = NT2US(maxLockedDuration); tsOutputChannels->maxTriggerReentrant = maxTriggerReentrant; #endif /* EFI_CLOCK_LOCKS */ diff --git a/firmware/controllers/algo/runtime_state.cpp b/firmware/controllers/algo/runtime_state.cpp index c75eb5e665..b0494bd62e 100644 --- a/firmware/controllers/algo/runtime_state.cpp +++ b/firmware/controllers/algo/runtime_state.cpp @@ -17,8 +17,8 @@ extern uint32_t hipLastExecutionCount; extern uint32_t maxLockedDuration; extern uint32_t maxEventCallbackDuration; extern uint32_t triggerMaxDuration; -extern int perSecondIrqDuration; -extern int perSecondIrqCounter; + +extern int maxTriggerReentrant; #if EFI_PROD_CODE extern uint32_t maxPrecisionCallbackDuration; @@ -47,10 +47,6 @@ void printRuntimeStats(void) { #if EFI_CLOCK_LOCKS efiPrintf("maxLockedDuration=%d / maxTriggerReentrant=%d", maxLockedDuration, maxTriggerReentrant); - - efiPrintf("perSecondIrqDuration=%d ticks / perSecondIrqCounter=%d", perSecondIrqDuration, perSecondIrqCounter); - efiPrintf("IRQ CPU utilization %f%%", perSecondIrqDuration / (float)CORE_CLOCK * 100); - #endif /* EFI_CLOCK_LOCKS */ efiPrintf("maxEventCallbackDuration=%d", maxEventCallbackDuration);