diff --git a/firmware/config/boards/nucleo_f746/!compile-stm32f746_nucleo.bat b/firmware/config/boards/nucleo_f746/!compile-stm32f746_nucleo.bat index 96e77ab09f..82ba4ff18a 100644 --- a/firmware/config/boards/nucleo_f746/!compile-stm32f746_nucleo.bat +++ b/firmware/config/boards/nucleo_f746/!compile-stm32f746_nucleo.bat @@ -12,7 +12,9 @@ set EXTRA_PARAMS=-DDUMMY -DSTM32F746xx ^ -DEFI_INJECTOR_PIN3=GPIO_UNASSIGNED ^ -DEFI_COMMUNICATION_PIN=GPIOB_7 ^ -DEFI_FATAL_ERROR_PIN=GPIOB_14 ^ - -DRAM_UNUSED_SIZE=10 -DCCM_UNUSED_SIZE=10 + -DEFI_TOOTH_LOGGER=FALSE ^ + -DRAM_UNUSED_SIZE=10 ^ + -DCCM_UNUSED_SIZE=10 set DEBUG_LEVEL_OPT="-O2" call config/boards/common_make.bat diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index 77f3397578..773ce64055 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -18,6 +18,10 @@ #define EFI_CDM_INTEGRATION TRUE #endif +#ifndef EFI_TOOTH_LOGGER +#define EFI_TOOTH_LOGGER TRUE +#endif + #define EFI_TEXT_LOGGING TRUE #define EFI_PWM_TESTER FALSE diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 963b6648bd..3b26f6e714 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -794,7 +794,8 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin sendOkResponse(tsChannel, TS_CRC); } break; - case TS_SET_LOGGER_MODE: +#if EFI_TOOTH_LOGGER + case TS_SET_LOGGER_MODE: switch(data[0]) { case 0x01: EnableToothLogger(); @@ -817,6 +818,7 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin } break; +#endif /* EFI_TOOTH_LOGGER */ default: tunerStudioError("ERROR: ignoring unexpected command"); return false; diff --git a/firmware/console/tooth_logger.cpp b/firmware/console/tooth_logger.cpp index 241b64c1e1..9e14a5adbe 100644 --- a/firmware/console/tooth_logger.cpp +++ b/firmware/console/tooth_logger.cpp @@ -1,8 +1,18 @@ +/* + * @file tooth_logger.cpp + * + * @date Jul 7, 2019 + * @author Matthew Kennedy + */ + #include "tooth_logger.h" +#include "global.h" + +#if EFI_TOOTH_LOGGER + #include #include "efitime.h" -#include "global.h" #include "efilib.h" #include "tunerstudio_configuration.h" @@ -70,3 +80,5 @@ void DisableToothLogger() { ToothLoggerBuffer GetToothLoggerBuffer() { return { reinterpret_cast(buffer), sizeof(buffer) }; } + +#endif /* EFI_TOOTH_LOGGER */ diff --git a/firmware/console/tooth_logger.h b/firmware/console/tooth_logger.h index 8e4d7354fe..8e33112f38 100644 --- a/firmware/console/tooth_logger.h +++ b/firmware/console/tooth_logger.h @@ -1,3 +1,10 @@ +/* + * @file tooth_logger.h + * + * @date Jul 7, 2019 + * @author Matthew Kennedy + */ + #pragma once #include diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index c209d7853e..483c930125 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -191,10 +191,12 @@ static bool isInsideTriggerHandler = false; void hwHandleShaftSignal(trigger_event_e signal) { +#if EFI_TOOTH_LOGGER // 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 occuring + // actually want to capture any noise/jitter that may be occurring LogTriggerTooth(signal); +#endif /* EFI_TOOTH_LOGGER */ // for effective noise filtering, we need both signal edges, // so we pass them to handleShaftSignal() and defer this test diff --git a/simulator/simulator/efifeatures.h b/simulator/simulator/efifeatures.h index 5e503e5eca..714e9f45eb 100644 --- a/simulator/simulator/efifeatures.h +++ b/simulator/simulator/efifeatures.h @@ -42,6 +42,10 @@ #define EFI_MEMS FALSE +#ifndef EFI_TOOTH_LOGGER +#define EFI_TOOTH_LOGGER TRUE +#endif + #define CONSOLE_MAX_ACTIONS 256 #define EFI_SIMULATOR TRUE