multi-channel Tuner Studio tooth logger #1284

This commit is contained in:
rusefi 2020-04-17 12:14:45 -04:00
parent 1a1f81d9cb
commit ed0e5e2aac
2 changed files with 19 additions and 2 deletions

View File

@ -716,6 +716,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20200416;
return 20200417;
}
#endif /* EFI_UNIT_TEST */

View File

@ -229,7 +229,14 @@ void hwHandleShaftSignal(trigger_event_e signal, efitick_t timestamp) {
// Log to the Tunerstudio tooth logger
// We want to do this before anything else as we
// actually want to capture any noise/jitter that may be occurring
bool logLogicState = CONFIG(displayLogicLevelsInEngineSniffer && engineConfiguration->useOnlyRisingEdgeForTrigger);
if (!logLogicState) {
// we log physical state even if displayLogicLevelsInEngineSniffer if both fronts are used by decoder
LogTriggerTooth(signal, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
}
#endif /* EFI_TOOTH_LOGGER */
// for effective noise filtering, we need both signal edges,
@ -239,6 +246,16 @@ void hwHandleShaftSignal(trigger_event_e signal, efitick_t timestamp) {
return;
}
}
if (logLogicState) {
LogTriggerTooth(signal, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
if (signal == SHAFT_PRIMARY_RISING) {
LogTriggerTooth(SHAFT_PRIMARY_FALLING, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
} else {
LogTriggerTooth(SHAFT_SECONDARY_FALLING, timestamp PASS_ENGINE_PARAMETER_SUFFIX);
}
}
uint32_t triggerHandlerEntryTime = getTimeNowLowerNt();
if (triggerReentraint > maxTriggerReentraint)
maxTriggerReentraint = triggerReentraint;