From d8281626df424e3a97d7bba4f41d8edfd024aa13 Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 12 Apr 2019 22:10:57 -0400 Subject: [PATCH] defined(__DOXYGEN__) ? fix #748 --- firmware/bootloader/bootloader_storage.c | 2 +- firmware/config/engines/audi_aan.cpp | 2 +- firmware/config/engines/custom_engine.cpp | 8 +- firmware/config/engines/dodge_neon.cpp | 4 +- .../config/engines/ford_1995_inline_6.cpp | 2 +- firmware/config/engines/ford_aspire.cpp | 2 +- firmware/config/engines/ford_festiva.cpp | 2 +- firmware/config/engines/ford_fiesta.cpp | 2 +- firmware/config/engines/ford_fiesta.h | 2 +- firmware/config/engines/honda_600.cpp | 2 +- firmware/config/engines/lada_kalina.cpp | 2 +- firmware/config/engines/mazda_626.cpp | 2 +- firmware/config/engines/mazda_miata_1_6.cpp | 2 +- firmware/config/engines/mitsubishi.cpp | 2 +- firmware/config/engines/nissan_primera.cpp | 2 +- firmware/config/engines/test_engine.cpp | 2 +- firmware/config/stm32f4ems/efifeatures.h | 6 +- firmware/console/binary/bluetooth.cpp | 2 +- firmware/console/binary/tunerstudio.cpp | 50 ++++----- firmware/console/binary/tunerstudio_io.cpp | 24 ++-- firmware/console/binary/tunerstudio_io.h | 2 +- firmware/console/console_io.cpp | 24 ++-- firmware/console/eficonsole.cpp | 4 +- firmware/console/status_loop.cpp | 106 +++++++++--------- firmware/development/engine_emulator.cpp | 2 +- firmware/development/engine_sniffer.cpp | 18 +-- firmware/development/engine_sniffer.h | 2 +- firmware/development/hw_layer/poten.cpp | 4 +- firmware/development/hw_layer/poten.h | 2 +- firmware/development/rfi_perftest.cpp | 8 +- firmware/development/sensor_chart.cpp | 6 +- firmware/development/test/test.c | 2 +- firmware/development/test/test.h | 4 +- firmware/development/test/testbmk.c | 26 ++--- firmware/development/trigger_emulator.cpp | 6 +- firmware/development/wave_analyzer.cpp | 8 +- firmware/development/wave_analyzer.h | 2 +- firmware/rusefi.cpp | 14 +-- firmware/util/cli_registry.cpp | 14 +-- firmware/util/datalogging.cpp | 2 +- firmware/util/loggingcentral.cpp | 12 +- firmware/util/math/interpolation.cpp | 2 +- firmware/util/math/pid.cpp | 4 +- firmware/util/math/pid.h | 2 +- simulator/simulator/rusEfiFunctionalTest.cpp | 2 +- 45 files changed, 200 insertions(+), 200 deletions(-) diff --git a/firmware/bootloader/bootloader_storage.c b/firmware/bootloader/bootloader_storage.c index cef68edded..be430f9e9b 100644 --- a/firmware/bootloader/bootloader_storage.c +++ b/firmware/bootloader/bootloader_storage.c @@ -2,7 +2,7 @@ #include "global.h" #include "bootloader/bootloader.h" -#if defined(EFI_BOOTLOADER_INCLUDE_CODE) || defined(__DOXYGEN__) +#if defined(EFI_BOOTLOADER_INCLUDE_CODE) #if defined __GNUC__ #define BOOTLOADER_SECTION __attribute__((section(".bl"))) /* todo: add 'used'? */ diff --git a/firmware/config/engines/audi_aan.cpp b/firmware/config/engines/audi_aan.cpp index b6fb456588..a208220c82 100644 --- a/firmware/config/engines/audi_aan.cpp +++ b/firmware/config/engines/audi_aan.cpp @@ -22,7 +22,7 @@ #include "global.h" -#if EFI_ENGINE_AUDI_AAN || defined(__DOXYGEN__) +#if EFI_ENGINE_AUDI_AAN #include "engine_controller.h" diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index 5dc01c9d0e..c4ee5e6b44 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -18,7 +18,7 @@ #include "engine_math.h" #include "fsio_impl.h" -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE #include "can_hw.h" #include "scheduler.h" #include "electronic_throttle.h" @@ -27,7 +27,7 @@ EXTERN_ENGINE; -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE static int periodIndex = 0; static OutputPin testPin; @@ -206,7 +206,7 @@ void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // todo: 8.2 or 10k? engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2; -#if EFI_CAN_SUPPORT || defined(__DOXYGEN__) +#if EFI_CAN_SUPPORT enableFrankensoCan(); #endif /* EFI_CAN_SUPPORT */ } @@ -284,7 +284,7 @@ void setEtbTestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { CONFIGB(etb1.directionPin2) = GPIOC_9; CONFIGB(etb1.controlPin1) = GPIOE_14; -#if EFI_ELECTRONIC_THROTTLE_BODY || defined(__DOXYGEN__) +#if EFI_ELECTRONIC_THROTTLE_BODY setDefaultEtbParameters(PASS_ENGINE_PARAMETER_SIGNATURE); // values are above 100% since we have feedforward part of the total summation engineConfiguration->etb.minValue = -200; diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 48922485a6..f7fd308069 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -16,7 +16,7 @@ #include "global.h" -#if EFI_SUPPORT_DODGE_NEON || defined(__DOXYGEN__) +#if EFI_SUPPORT_DODGE_NEON #include "dodge_neon.h" #include "engine_configuration.h" @@ -454,7 +454,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->auxPid[0].dFactor = 0.1; -#if EFI_FSIO || defined(__DOXYGEN__) +#if EFI_FSIO // /** // * set_fsio_setting 1 0.55 // */ diff --git a/firmware/config/engines/ford_1995_inline_6.cpp b/firmware/config/engines/ford_1995_inline_6.cpp index dd547b99de..94ab49c27a 100644 --- a/firmware/config/engines/ford_1995_inline_6.cpp +++ b/firmware/config/engines/ford_1995_inline_6.cpp @@ -18,7 +18,7 @@ #include "engine_math.h" #include "allsensors.h" -#if EFI_SUPPORT_1995_FORD_INLINE_6 || defined(__DOXYGEN__) +#if EFI_SUPPORT_1995_FORD_INLINE_6 EXTERN_ENGINE; diff --git a/firmware/config/engines/ford_aspire.cpp b/firmware/config/engines/ford_aspire.cpp index 27227fb014..fac75c54b2 100644 --- a/firmware/config/engines/ford_aspire.cpp +++ b/firmware/config/engines/ford_aspire.cpp @@ -18,7 +18,7 @@ #include "advance_map.h" #include "engine_configuration.h" -#if EFI_SUPPORT_FORD_ASPIRE || defined(__DOXYGEN__) +#if EFI_SUPPORT_FORD_ASPIRE /** * This is just the default map which is stored into flash memory in case flash is empty diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index 039f7054c8..a7c8d03ce6 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -224,7 +224,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2; // VICS solenoid -#if EFI_FSIO || defined(__DOXYGEN__) +#if EFI_FSIO /** * to test * set_fsio_setting 1 5000 diff --git a/firmware/config/engines/ford_fiesta.cpp b/firmware/config/engines/ford_fiesta.cpp index 97f43c44aa..e9cb1bb587 100644 --- a/firmware/config/engines/ford_fiesta.cpp +++ b/firmware/config/engines/ford_fiesta.cpp @@ -11,7 +11,7 @@ #include "global.h" -#if EFI_SUPPORT_FORD_FIESTA || defined(__DOXYGEN__) +#if EFI_SUPPORT_FORD_FIESTA #include "ford_fiesta.h" #include "engine_math.h" diff --git a/firmware/config/engines/ford_fiesta.h b/firmware/config/engines/ford_fiesta.h index b88f2d755a..b2b222a552 100644 --- a/firmware/config/engines/ford_fiesta.h +++ b/firmware/config/engines/ford_fiesta.h @@ -7,7 +7,7 @@ #ifndef FORD_FIESTA_H_ #define FORD_FIESTA_H_ -#if EFI_SUPPORT_FORD_FIESTA || defined(__DOXYGEN__) +#if EFI_SUPPORT_FORD_FIESTA #include "engine.h" diff --git a/firmware/config/engines/honda_600.cpp b/firmware/config/engines/honda_600.cpp index dfb1d53893..31f2e01429 100644 --- a/firmware/config/engines/honda_600.cpp +++ b/firmware/config/engines/honda_600.cpp @@ -164,7 +164,7 @@ void setHonda600(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // todo: 8.2 or 10k? engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2; -#if EFI_CAN_SUPPORT || defined(__DOXYGEN__) +#if EFI_CAN_SUPPORT enableFrankensoCan(); #endif /* EFI_CAN_SUPPORT */ } diff --git a/firmware/config/engines/lada_kalina.cpp b/firmware/config/engines/lada_kalina.cpp index 40162a384f..ed4f346581 100644 --- a/firmware/config/engines/lada_kalina.cpp +++ b/firmware/config/engines/lada_kalina.cpp @@ -50,7 +50,7 @@ void setLadaKalina(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // starter relay solenoid -#if EFI_FSIO || defined(__DOXYGEN__) +#if EFI_FSIO /** * to test * set_fsio_setting 1 5000 diff --git a/firmware/config/engines/mazda_626.cpp b/firmware/config/engines/mazda_626.cpp index 9cb3c4b68c..be9d88e58d 100644 --- a/firmware/config/engines/mazda_626.cpp +++ b/firmware/config/engines/mazda_626.cpp @@ -97,7 +97,7 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX); -//#if EFI_FSIO || defined(__DOXYGEN__) +//#if EFI_FSIO // // backup main relay pin // setFsio(0, GPIOE_6, "1" PASS_ENGINE_PARAMETER_SUFFIX); //#endif diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp index 8bed90d407..ffc3fe03ae 100644 --- a/firmware/config/engines/mazda_miata_1_6.cpp +++ b/firmware/config/engines/mazda_miata_1_6.cpp @@ -230,7 +230,7 @@ void setMiataNA6_MAP_Configuration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // set_fsio_expression 0 "((rpm > fsio_setting(4) & (fsio_analog_input < fsio_setting(5)) | rpm > fsio_setting(1) | (coolant > fsio_setting(2) > | (vbatt < fsio_setting(3)" -#if EFI_FSIO || defined(__DOXYGEN__) +#if EFI_FSIO // todo: convert setFsio(0, GPIOC_13, COMBINED_WARNING_LIGHT PASS_ENGINE_PARAMETER_SUFFIX); #endif /* EFI_FSIO */ diff --git a/firmware/config/engines/mitsubishi.cpp b/firmware/config/engines/mitsubishi.cpp index aac308044c..33c5c666ee 100644 --- a/firmware/config/engines/mitsubishi.cpp +++ b/firmware/config/engines/mitsubishi.cpp @@ -84,7 +84,7 @@ void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->HD44780height = 4; setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX); -#if EFI_FSIO || defined(__DOXYGEN__) +#if EFI_FSIO setFsioExt(0, GPIOC_9, RPM_ABOVE_6000_SOLENOID_80_DUTY, 200 PASS_ENGINE_PARAMETER_SUFFIX); setFsioExt(1, GPIOC_7, RPM_ABOVE_2000_SOLENOID_50_DUTY, 200 PASS_ENGINE_PARAMETER_SUFFIX); #endif /* EFI_FSIO */ diff --git a/firmware/config/engines/nissan_primera.cpp b/firmware/config/engines/nissan_primera.cpp index ef03b08841..ea54528650 100644 --- a/firmware/config/engines/nissan_primera.cpp +++ b/firmware/config/engines/nissan_primera.cpp @@ -9,7 +9,7 @@ #include "global.h" -#if EFI_SUPPORT_NISSAN_PRIMERA || defined(__DOXYGEN__) +#if EFI_SUPPORT_NISSAN_PRIMERA #include "nissan_primera.h" void setNissanPrimeraEngineConfiguration(engine_configuration_s *engineConfiguration) { diff --git a/firmware/config/engines/test_engine.cpp b/firmware/config/engines/test_engine.cpp index 2798f88dce..31099a18e2 100644 --- a/firmware/config/engines/test_engine.cpp +++ b/firmware/config/engines/test_engine.cpp @@ -73,7 +73,7 @@ void setTestVVTEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->debugMode = DBG_VVT; } -#if EFI_UNIT_TEST || defined(__DOXYGEN__) +#if EFI_UNIT_TEST void setTestEngineIssue366both(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setTestEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index d1676a9be0..7b0f6e8372 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -38,11 +38,11 @@ * in chconf.h * */ -#if !defined(EFI_ENABLE_ASSERTS) || defined(__DOXYGEN__) +#if !defined(EFI_ENABLE_ASSERTS) #define EFI_ENABLE_ASSERTS TRUE #endif /* EFI_ENABLE_ASSERTS */ -#if !defined(EFI_ENABLE_MOCK_ADC) || defined(__DOXYGEN__) +#if !defined(EFI_ENABLE_MOCK_ADC) #define EFI_ENABLE_MOCK_ADC TRUE #endif /* EFI_ENABLE_MOCK_ADC */ @@ -141,7 +141,7 @@ #define EFI_CJ125 TRUE #endif -#if !defined(EFI_MEMS) || defined(__DOXYGEN__) +#if !defined(EFI_MEMS) #define EFI_MEMS FALSE #endif diff --git a/firmware/console/binary/bluetooth.cpp b/firmware/console/binary/bluetooth.cpp index 9492f86960..99c0fc0d09 100644 --- a/firmware/console/binary/bluetooth.cpp +++ b/firmware/console/binary/bluetooth.cpp @@ -7,7 +7,7 @@ #include "bluetooth.h" #include "engine_configuration.h" -#if EFI_BLUETOOTH_SETUP || defined(__DOXYGEN__) +#if EFI_BLUETOOTH_SETUP static bool btProcessIsStarted = false; static bool btProcessIsRunning = false; diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index c9b98e7be2..2aef9a17ef 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -82,11 +82,11 @@ #include "loggingcentral.h" #include "status_loop.h" #include "mmc_card.h" -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR #include "rusEfiFunctionalTest.h" #endif -#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO EXTERN_ENGINE ; @@ -101,7 +101,7 @@ extern short currentPageId; */ LoggingWithStorage tsLogger("binary"); -#if !defined(EFI_NO_CONFIG_WORKING_COPY) || defined(__DOXYGEN__) +#if !defined(EFI_NO_CONFIG_WORKING_COPY) /** * this is a local copy of the configuration. Any changes to this copy * have no effect until this copy is explicitly propagated to the main working copy @@ -139,7 +139,7 @@ static void printErrorCounters(void) { } void printTsStats(void) { -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE if (false) { // todo: is this code needed somewhere else? scheduleMsg(&tsLogger, "TS RX on %s", hwPortname(engineConfiguration->binarySerialRxPin)); @@ -172,7 +172,7 @@ static void setTsSpeed(int value) { printTsStats(); } -#if EFI_BLUETOOTH_SETUP || defined(__DOXYGEN__) +#if EFI_BLUETOOTH_SETUP // Bluetooth HC-05 module initialization start (it waits for disconnect and then communicates to the module) static void bluetoothHC05(const char *baudRate, const char *name, const char *pinCode) { bluetoothStart(&tsChannel, BLUETOOTH_HC_05, baudRate, name, pinCode); @@ -188,7 +188,7 @@ static void bluetoothSPP(const char *baudRate, const char *name, const char *pin #endif /* EFI_BLUETOOTH_SETUP */ void tunerStudioDebug(const char *msg) { -#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO_VERBOSE scheduleMsg(&tsLogger, "%s", msg); #endif } @@ -196,7 +196,7 @@ void tunerStudioDebug(const char *msg) { char *getWorkingPageAddr(int pageIndex) { switch (pageIndex) { case 0: -#if !defined(EFI_NO_CONFIG_WORKING_COPY) || defined(__DOXYGEN__) +#if !defined(EFI_NO_CONFIG_WORKING_COPY) return (char*) &configWorkingCopy.engineConfiguration; #else return (char*) &engineConfiguration; @@ -274,7 +274,7 @@ static void onlineApplyWorkingCopyBytes(int currentPageId, uint32_t offset, int return; } scheduleMsg(&tsLogger, "applying soft change from %d length %d", offset, count); -#if !defined(EFI_NO_CONFIG_WORKING_COPY) || defined(__DOXYGEN__) +#if !defined(EFI_NO_CONFIG_WORKING_COPY) memcpy(((char*) &persistentState.persistentConfiguration) + offset, ((char*) &configWorkingCopy) + offset, count); #endif /* EFI_NO_CONFIG_WORKING_COPY */ @@ -285,7 +285,7 @@ static void onlineApplyWorkingCopyBytes(int currentPageId, uint32_t offset, int * read log file content for rusEfi console */ static void handleReadFileContent(ts_channel_s *tsChannel, short fileId, short offset, short length) { -#if EFI_FILE_LOGGING || defined(__DOXYGEN__) +#if EFI_FILE_LOGGING readLogFileContent(tsChannel->crcReadBuffer, fileId, offset, length); #endif /* EFI_FILE_LOGGING */ } @@ -350,7 +350,7 @@ void handleWriteValueCommand(ts_channel_s *tsChannel, ts_response_format_e mode, tunerStudioDebug("got W (Write)"); // we can get a lot of these -#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO_VERBOSE // scheduleMsg(logger, "Page number %d\r\n", pageId); // we can get a lot of these #endif @@ -386,7 +386,7 @@ void handlePageReadCommand(ts_channel_s *tsChannel, ts_response_format_e mode, u tsState.readPageCommandsCounter++; currentPageId = pageId; -#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO_VERBOSE scheduleMsg(&tsLogger, "READ mode=%d page=%d offset=%d size=%d", mode, (int) currentPageId, offset, count); #endif @@ -407,13 +407,13 @@ void handlePageReadCommand(ts_channel_s *tsChannel, ts_response_format_e mode, u const uint8_t *addr = (const uint8_t *) (getWorkingPageAddr(currentPageId) + offset); sr5SendResponse(tsChannel, mode, addr, count); -#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO_VERBOSE // scheduleMsg(&tsLogger, "Sending %d done", count); #endif } void requestBurn(void) { -#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__) +#if EFI_INTERNAL_FLASH setNeedToWriteConfiguration(); #endif incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); @@ -436,13 +436,13 @@ void handleBurnCommand(ts_channel_s *tsChannel, ts_response_format_e mode, uint1 currentPageId = page; -#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO_VERBOSE // pointless since we only have one page now // scheduleMsg(logger, "Page number %d", currentPageId); #endif // todo: how about some multi-threading? -#if !defined(EFI_NO_CONFIG_WORKING_COPY) || defined(__DOXYGEN__) +#if !defined(EFI_NO_CONFIG_WORKING_COPY) memcpy(&persistentState.persistentConfiguration, &configWorkingCopy, sizeof(persistent_config_s)); #endif /* EFI_NO_CONFIG_WORKING_COPY */ @@ -483,14 +483,14 @@ void runBinaryProtocolLoop(ts_channel_s *tsChannel) { uint8_t firstByte; int received = sr5ReadData(tsChannel, &firstByte, 1); -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR logMsg("received %d\r\n", received); #endif if (received != 1) { // tunerStudioError("ERROR: no command"); -#if EFI_BLUETOOTH_SETUP || defined(__DOXYGEN__) +#if EFI_BLUETOOTH_SETUP // assume there's connection loss and notify the bluetooth init code bluetoothSoftwareDisconnectNotify(); #endif /* EFI_BLUETOOTH_SETUP */ @@ -538,7 +538,7 @@ void runBinaryProtocolLoop(ts_channel_s *tsChannel) { continue; } -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR logMsg("command %c\r\n", command); #endif @@ -595,7 +595,7 @@ static THD_FUNCTION(tsThreadEntryPoint, arg) { * Copy real configuration into the communications layer working copy */ void syncTunerStudioCopy(void) { -#if !defined(EFI_NO_CONFIG_WORKING_COPY) || defined(__DOXYGEN__) +#if !defined(EFI_NO_CONFIG_WORKING_COPY) memcpy(&configWorkingCopy, &persistentState.persistentConfiguration, sizeof(persistent_config_s)); #endif /* EFI_NO_CONFIG_WORKING_COPY */ } @@ -617,7 +617,7 @@ void tunerStudioError(const char *msg) { */ void handleQueryCommand(ts_channel_s *tsChannel, ts_response_format_e mode) { tsState.queryCommandCounter++; -#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO_VERBOSE scheduleMsg(&tsLogger, "got S/H (queryCommand) mode=%d", mode); printTsStats(); #endif @@ -675,12 +675,12 @@ static void handleGetText(ts_channel_s *tsChannel) { int outputSize; char *output = swapOutputBuffers(&outputSize); -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR logMsg("get test sending [%d]\r\n", outputSize); #endif sr5WriteCrcPacket(tsChannel, TS_RESPONSE_COMMAND_OK, output, outputSize); -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR logMsg("sent [%d]\r\n", outputSize); #endif } @@ -689,7 +689,7 @@ static void handleExecuteCommand(ts_channel_s *tsChannel, char *data, int incomi sr5WriteCrcPacket(tsChannel, TS_RESPONSE_COMMAND_OK, NULL, 0); data[incomingPacketSize] = 0; char *trimmed = efiTrim(data); -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR logMsg("execute [%s]\r\n", trimmed); #endif (console_line_callback)(trimmed); @@ -792,7 +792,7 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin } -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE executeTSCommand(subsystem, index); #endif /* EFI_PROD_CODE */ sendOkResponse(tsChannel, TS_CRC); @@ -817,7 +817,7 @@ void startTunerStudioConnectivity(void) { addConsoleAction("reset_ts", resetTs); addConsoleActionI("set_ts_speed", setTsSpeed); -#if EFI_BLUETOOTH_SETUP || defined(__DOXYGEN__) +#if EFI_BLUETOOTH_SETUP // Usage: "bluetooth_hc06 " // Example: "bluetooth_hc06 38400 rusefi 1234" addConsoleActionSSS("bluetooth_hc05", bluetoothHC05); diff --git a/firmware/console/binary/tunerstudio_io.cpp b/firmware/console/binary/tunerstudio_io.cpp index d31aaf2be3..393789963d 100644 --- a/firmware/console/binary/tunerstudio_io.cpp +++ b/firmware/console/binary/tunerstudio_io.cpp @@ -9,7 +9,7 @@ #include "tunerstudio_io.h" #include "console_io.h" #include "engine.h" -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR #include "rusEfiFunctionalTest.h" #endif @@ -17,11 +17,11 @@ EXTERN_ENGINE; extern LoggingWithStorage tsLogger; -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE #include "pin_repository.h" #include "usbconsole.h" -#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) +#if HAL_USE_SERIAL_USB extern SerialUSBDriver SDU1; #endif /* HAL_USE_SERIAL_USB */ @@ -84,8 +84,8 @@ static SerialConfig tsSerialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LI void startTsPort(ts_channel_s *tsChannel) { tsChannel->channel = (BaseChannel *) NULL; - #if EFI_PROD_CODE || defined(__DOXYGEN__) - #if defined(CONSOLE_USB_DEVICE) || defined(__DOXYGEN__) + #if EFI_PROD_CODE + #if defined(CONSOLE_USB_DEVICE) print("TunerStudio over USB serial"); /** * This method contains a long delay, that's the reason why this is not done on the main thread @@ -135,8 +135,8 @@ void startTsPort(ts_channel_s *tsChannel) { } bool stopTsPort(ts_channel_s *tsChannel) { - #if EFI_PROD_CODE || defined(__DOXYGEN__) - #if EFI_USB_SERIAL || defined(__DOXYGEN__) + #if EFI_PROD_CODE + #if EFI_USB_SERIAL // don't stop USB! //usb_serial_stop(); return false; @@ -160,7 +160,7 @@ bool stopTsPort(ts_channel_s *tsChannel) { void sr5WriteData(ts_channel_s *tsChannel, const uint8_t * buffer, int size) { efiAssertVoid(CUSTOM_ERR_6570, getCurrentRemainingStack() > 64, "tunerStudioWriteData"); -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR logMsg("chSequentialStreamWrite [%d]\r\n", size); #endif @@ -186,11 +186,11 @@ void sr5WriteData(ts_channel_s *tsChannel, const uint8_t * buffer, int size) { #endif -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR logMsg("transferred [%d]\r\n", transferred); #endif if (transferred != size) { -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR logMsg("!!! NOT ACCEPTED %d out of %d !!!", transferred, size); #endif /* EFI_SIMULATOR */ scheduleMsg(&tsLogger, "!!! NOT ACCEPTED %d out of %d !!!", transferred, size); @@ -198,7 +198,7 @@ void sr5WriteData(ts_channel_s *tsChannel, const uint8_t * buffer, int size) { } int sr5ReadDataTimeout(ts_channel_s *tsChannel, uint8_t * buffer, int size, int timeout) { -#if TS_UART_DMA_MODE || defined(__DOXYGEN__) +#if TS_UART_DMA_MODE UNUSED(tsChannel); return (int)iqReadTimeout(&tsUartDma.fifoRxQueue, (uint8_t * )buffer, (size_t)size, timeout); #elif TS_UART_MODE @@ -251,7 +251,7 @@ void sr5SendResponse(ts_channel_s *tsChannel, ts_response_format_e mode, const u } bool sr5IsReady(ts_channel_s *tsChannel) { -#if EFI_USB_SERIAL || defined(__DOXYGEN__) +#if EFI_USB_SERIAL if (isUsbSerial(tsChannel->channel)) { // TS uses USB when console uses serial return is_usb_serial_ready(); diff --git a/firmware/console/binary/tunerstudio_io.h b/firmware/console/binary/tunerstudio_io.h index 263f67290c..4413a13bf7 100644 --- a/firmware/console/binary/tunerstudio_io.h +++ b/firmware/console/binary/tunerstudio_io.h @@ -85,7 +85,7 @@ typedef struct { // todo: double-check this #define CRC_WRAPPING_SIZE (CRC_VALUE_SIZE + 3) -#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) +#if HAL_USE_SERIAL_USB #define CONSOLE_USB_DEVICE SDU1 #endif /* HAL_USE_SERIAL_USB */ diff --git a/firmware/console/console_io.cpp b/firmware/console/console_io.cpp index fd23a46602..af84e23ead 100644 --- a/firmware/console/console_io.cpp +++ b/firmware/console/console_io.cpp @@ -24,13 +24,13 @@ #include "rfiutil.h" #include "tunerstudio.h" -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR #include "rusEfiFunctionalTest.h" #endif /*EFI_SIMULATOR */ EXTERN_ENGINE; -#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) +#if HAL_USE_SERIAL_USB #include "usbcfg.h" #include "usbconsole.h" extern SerialUSBDriver SDU1; @@ -73,7 +73,7 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size) short c = (short) streamGet(chp); onDataArrived(); -#if defined(EFI_CONSOLE_UART_DEVICE) || defined(__DOXYGEN__) +#if defined(EFI_CONSOLE_UART_DEVICE) uint32_t flags; chSysLock() @@ -132,14 +132,14 @@ static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size) CommandHandler console_line_callback; -#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR ) || defined(__DOXYGEN__) +#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR ) static SerialConfig serialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 }; #endif -#if EFI_PROD_CODE || EFI_EGT || defined(__DOXYGEN__) +#if EFI_PROD_CODE || EFI_EGT bool isUsbSerial(BaseChannel * channel) { -#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) +#if HAL_USE_SERIAL_USB return channel == (BaseChannel *) &CONSOLE_USB_DEVICE; #else return false; @@ -147,11 +147,11 @@ bool isUsbSerial(BaseChannel * channel) { } BaseChannel * getConsoleChannel(void) { -#if defined(EFI_CONSOLE_UART_DEVICE) || defined(__DOXYGEN__) +#if defined(EFI_CONSOLE_UART_DEVICE) return (BaseChannel *) EFI_CONSOLE_UART_DEVICE; #endif /* EFI_CONSOLE_UART_DEVICE */ -#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) +#if HAL_USE_SERIAL_USB return (BaseChannel *) &CONSOLE_USB_DEVICE; #else return NULL; @@ -163,7 +163,7 @@ bool isCommandLineConsoleReady(void) { } #endif /* EFI_PROD_CODE || EFI_EGT */ -#if !defined(EFI_CONSOLE_NO_THREAD) || defined(__DOXYGEN__) +#if !defined(EFI_CONSOLE_NO_THREAD) ts_channel_s binaryConsole; @@ -174,7 +174,7 @@ static THD_FUNCTION(consoleThreadEntryPoint, arg) { binaryConsole.channel = (BaseChannel *) getConsoleChannel(); if (binaryConsole.channel != NULL) { -#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO runBinaryProtocolLoop(&binaryConsole); #endif /* EFI_TUNER_STUDIO */ } @@ -204,7 +204,7 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p) logger = sharedLogger; console_line_callback = console_line_callback_p; -#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR) || defined(__DOXYGEN__) +#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR) /* * Activates the serial * it is important to set 'NONE' as flow control! in terminal application on the PC @@ -221,7 +221,7 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p) chEvtRegisterMask((event_source_t *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1); #endif /* EFI_PROD_CODE */ -#if !defined(EFI_CONSOLE_NO_THREAD) || defined(__DOXYGEN__) +#if !defined(EFI_CONSOLE_NO_THREAD) chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, (tfunc_t)consoleThreadEntryPoint, NULL); #endif /* EFI_CONSOLE_NO_THREAD */ diff --git a/firmware/console/eficonsole.cpp b/firmware/console/eficonsole.cpp index 0903da91ac..27fd4a3de0 100644 --- a/firmware/console/eficonsole.cpp +++ b/firmware/console/eficonsole.cpp @@ -96,7 +96,7 @@ static void sayHello(void) { scheduleMsg(&logger, "EFI_SIGNAL_EXECUTOR_HW_TIMER=%d", EFI_SIGNAL_EXECUTOR_HW_TIMER); #endif -#if defined(EFI_SHAFT_POSITION_INPUT) || defined(__DOXYGEN__) +#if defined(EFI_SHAFT_POSITION_INPUT) scheduleMsg(&logger, "EFI_SHAFT_POSITION_INPUT=%d", EFI_SHAFT_POSITION_INPUT); #endif #ifdef EFI_INTERNAL_ADC @@ -116,7 +116,7 @@ static void sayHello(void) { * This methods prints all threads and their total times */ static void cmd_threads(void) { -#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__) +#if CH_DBG_THREADS_PROFILING /* todo: fix this code to work with fresh chibios static const char *states[] = { CH_STATE_NAMES }; thread_t *tp; diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index f0574125d6..12ec3ea2e7 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -30,7 +30,7 @@ #include "engine_controller.h" #include "adc_inputs.h" -#if EFI_WAVE_ANALYZER || defined(__DOXYGEN__) +#if EFI_WAVE_ANALYZER #include "wave_analyzer.h" #endif /* EFI_WAVE_ANALYZER */ @@ -63,7 +63,7 @@ extern afr_Map3D_t afrMap; extern bool main_loop_started; -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE // todo: move this logic to algo folder! #include "rtc_helper.h" #include "lcd_HD44780.h" @@ -75,7 +75,7 @@ extern bool main_loop_started; #include "single_timer_executor.h" #endif /* EFI_PROD_CODE */ -#if EFI_CJ125 || defined(__DOXYGEN__) +#if EFI_CJ125 #include "cj125.h" #endif /* EFI_CJ125 */ @@ -83,7 +83,7 @@ extern bool main_loop_started; #include "map_averaging.h" #endif -#if EFI_FSIO || defined(__DOXYGEN__) +#if EFI_FSIO #include "fsio_impl.h" #endif /* EFI_FSIO */ @@ -92,7 +92,7 @@ static volatile bool fullLog = true; int warningEnabled = true; //int warningEnabled = FALSE; -#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO extern TunerStudioOutputChannels tsOutputChannels; extern tunerstudio_counters_s tsState; #endif @@ -102,7 +102,7 @@ extern int maxTriggerReentraint; extern uint32_t maxLockedDuration; #define FULL_LOGGING_KEY "fl" -#if !defined(STATUS_LOGGING_BUFFER_SIZE) || defined(__DOXYGEN__) +#if !defined(STATUS_LOGGING_BUFFER_SIZE) #define STATUS_LOGGING_BUFFER_SIZE 1800 #endif /* STATUS_LOGGING_BUFFER_SIZE */ @@ -113,7 +113,7 @@ static void setWarningEnabled(int value) { warningEnabled = value; } -#if EFI_FILE_LOGGING || defined(__DOXYGEN__) +#if EFI_FILE_LOGGING // this one needs to be in main ram so that SD card SPI DMA works fine static char FILE_LOGGER[1000] MAIN_RAM; static Logging fileLogger("file logger", FILE_LOGGER, sizeof(FILE_LOGGER)); @@ -125,12 +125,12 @@ static int logFileLineIndex = 0; static void reportSensorF(Logging *log, bool isLogFileFormatting, const char *caption, const char *units, float value, int precision) { if (!isLogFileFormatting) { -#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) +#if EFI_PROD_CODE || EFI_SIMULATOR debugFloat(log, caption, value, precision); #endif /* EFI_PROD_CODE || EFI_SIMULATOR */ } else { -#if EFI_FILE_LOGGING || defined(__DOXYGEN__) +#if EFI_FILE_LOGGING if (logFileLineIndex == 0) { append(log, caption); append(log, TAB); @@ -148,11 +148,11 @@ static void reportSensorF(Logging *log, bool isLogFileFormatting, const char *ca static void reportSensorI(Logging *log, bool fileFormat, const char *caption, const char *units, int value) { if (!fileFormat) { -#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) +#if EFI_PROD_CODE || EFI_SIMULATOR debugInt(log, caption, value); #endif /* EFI_PROD_CODE || EFI_SIMULATOR */ } else { -#if EFI_FILE_LOGGING || defined(__DOXYGEN__) +#if EFI_FILE_LOGGING if (logFileLineIndex == 0) { append(log, caption); append(log, TAB); @@ -188,7 +188,7 @@ static void printSensors(Logging *log, bool fileFormat) { reportSensorF(log, fileFormat, "time", "", sec, 3); // log column 1 int rpm = 0; -#if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) +#if EFI_SHAFT_POSITION_INPUT rpm = GET_RPM(); reportSensorI(log, fileFormat, "rpm", "RPM", rpm); // log column 2 #endif @@ -208,13 +208,13 @@ static void printSensors(Logging *log, bool fileFormat) { if (hasVBatt(PASS_ENGINE_PARAMETER_SIGNATURE)) { reportSensorF(log, fileFormat, GAUGE_NAME_VBAT, "V", getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE), 2); // log column #6 } -#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) +#if EFI_ANALOG_SENSORS if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) { reportSensorF(log, fileFormat, "MAP", "kPa", getMap(), 2); // reportSensorF(log, fileFormat, "map_r", "V", getRawMap(), 2); } #endif /* EFI_ANALOG_SENSORS */ -#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) +#if EFI_ANALOG_SENSORS if (hasBaroSensor()) { reportSensorF(log, fileFormat, "baro", "kPa", getBaroPressure(), 2); } @@ -232,7 +232,7 @@ static void printSensors(Logging *log, bool fileFormat) { // below are the more advanced data points which only go into log file -#if HAL_USE_ADC || defined(__DOXYGEN__) +#if HAL_USE_ADC reportSensorF(log, fileFormat, GAUGE_NAME_CPU_TEMP, "C", getMCUInternalTemperature(), 2); // log column #3 #endif @@ -246,18 +246,18 @@ static void printSensors(Logging *log, bool fileFormat) { reportSensorF(log, fileFormat, "mafr", "kg/hr", getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE), 2); } -#if EFI_IDLE_CONTROL || defined(__DOXYGEN__) +#if EFI_IDLE_CONTROL reportSensorF(log, fileFormat, GAUGE_NAME_IAC, "%", getIdlePosition(), 2); #endif /* EFI_IDLE_CONTROL */ -#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) +#if EFI_ANALOG_SENSORS reportSensorF(log, fileFormat, GAUGE_NAME_TARGET_AFR, "AFR", engine->engineState.targetAFR, 2); #endif /* EFI_ANALOG_SENSORS */ #define DEBUG_F_PRECISION 6 -#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO reportSensorF(log, fileFormat, GAUGE_NAME_DEBUG_F1, "v", tsOutputChannels.debugFloatField1, DEBUG_F_PRECISION); reportSensorF(log, fileFormat, GAUGE_NAME_DEBUG_F1, "v", tsOutputChannels.debugFloatField2, DEBUG_F_PRECISION); reportSensorF(log, fileFormat, GAUGE_NAME_DEBUG_F1, "v", tsOutputChannels.debugFloatField3, DEBUG_F_PRECISION); @@ -297,7 +297,7 @@ static void printSensors(Logging *log, bool fileFormat) { reportSensorI(log, fileFormat, GAUGE_NAME_VERSION, "#", getRusEfiVersion()); -#if EFI_VEHICLE_SPEED || defined(__DOXYGEN__) +#if EFI_VEHICLE_SPEED if (hasVehicleSpeedSensor()) { float vehicleSpeed = getVehicleSpeed(); reportSensorF(log, fileFormat, GAUGE_NAME_VVS, "kph", vehicleSpeed, 2); @@ -347,7 +347,7 @@ static void printSensors(Logging *log, bool fileFormat) { void writeLogLine(void) { -#if EFI_FILE_LOGGING || defined(__DOXYGEN__) +#if EFI_FILE_LOGGING if (!main_loop_started) return; resetLogging(&fileLogger); @@ -379,7 +379,7 @@ static void printStatus(void) { */ static systime_t timeOfPreviousPrintVersion = (systime_t) -1; -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE static void printOutPin(const char *pinName, brain_pin_e hwPin) { if (hwPin != GPIO_UNASSIGNED) { appendPrintf(&logger, "outpin%s%s@%s%s", DELIMETER, pinName, hwPortname(hwPin), DELIMETER); @@ -398,14 +398,14 @@ void printOverallStatus(systime_t nowSeconds) { timeOfPreviousPrintVersion = nowSeconds; int seconds = getTimeNowSeconds(); printCurrentState(&logger, seconds, getConfigurationName(engineConfiguration->engineType)); -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE printOutPin(CRANK1, CONFIGB(triggerInputPins)[0]); printOutPin(CRANK2, CONFIGB(triggerInputPins)[1]); printOutPin(VVT_NAME, engineConfiguration->camInput); printOutPin(HIP_NAME, CONFIGB(hip9011IntHoldPin)); printOutPin(TACH_NAME, CONFIGB(tachOutputPin)); printOutPin(DIZZY_NAME, engineConfiguration->dizzySparkOutputPin); -#if EFI_WAVE_ANALYZER || defined(__DOXYGEN__) +#if EFI_WAVE_ANALYZER printOutPin(WA_CHANNEL_1, CONFIGB(logicAnalyzerPins)[0]); printOutPin(WA_CHANNEL_2, CONFIGB(logicAnalyzerPins)[1]); #endif /* EFI_WAVE_ANALYZER */ @@ -448,7 +448,7 @@ void updateDevConsoleState(void) { */ printSensors(&logger, false); -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE // todo: unify with simulator! if (hasFirmwareError()) { scheduleMsg(&logger, "FATAL error: %s", getFirmwareError()); @@ -458,7 +458,7 @@ void updateDevConsoleState(void) { } #endif -#if (EFI_PROD_CODE && HAL_USE_ADC) || defined(__DOXYGEN__) +#if EFI_PROD_CODE && HAL_USE_ADC printFullAdcReportIfNeeded(&logger); #endif @@ -468,7 +468,7 @@ void updateDevConsoleState(void) { systime_t nowSeconds = getTimeNowSeconds(); -#if (EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT) || defined(__DOXYGEN__) +#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT int currentCkpEventCounter = engine->triggerCentral.triggerState.getTotalEventCounter(); if (prevCkpEventCounter == currentCkpEventCounter && timeOfPreviousReport == nowSeconds) { return; @@ -510,7 +510,7 @@ static void showFuelInfo2(float rpm, float engineLoad) { scheduleMsg(&logger2, "baro correction=%.2f", engine->engineState.baroCorrection); -#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) +#if EFI_ENGINE_CONTROL scheduleMsg(&logger, "base cranking fuel %.2f", engineConfiguration->cranking.baseFuel); scheduleMsg(&logger2, "cranking fuel: %.2f", getCrankingFuel(PASS_ENGINE_PARAMETER_SIGNATURE)); @@ -530,7 +530,7 @@ static void showFuelInfo2(float rpm, float engineLoad) { #endif } -#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) +#if EFI_ENGINE_CONTROL static void showFuelInfo(void) { showFuelInfo2((float) GET_RPM(), getEngineLoadT(PASS_ENGINE_PARAMETER_SIGNATURE)); } @@ -584,10 +584,10 @@ static void setBlinkingPeriod(int value) { blinkingPeriodMs = value; } -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE static bool isTriggerErrorNow() { -#if (EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT) || defined(__DOXYGEN__) +#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT // todo: WAT? how is communication LED blinkingPeriodMs part of trigger error condition?! bool justHadError = (getTimeNowNt() - engine->triggerCentral.triggerState.lastDecodingErrorTime) < US2NT(2 * 1000 * 3 * blinkingPeriodMs); return justHadError || isTriggerDecoderError(); @@ -610,7 +610,7 @@ static void blinkingThread(void *arg) { while (true) { int onTimeMs = is_usb_serial_ready() ? 3 * blinkingPeriodMs : blinkingPeriodMs; -#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__) +#if EFI_INTERNAL_FLASH if (getNeedToWriteConfiguration()) { onTimeMs = 2 * onTimeMs; } @@ -630,7 +630,7 @@ static void blinkingThread(void *arg) { chThdSleepMilliseconds(offTimeMs); enginePins.communicationLedPin.setValue(1); -#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) +#if EFI_ENGINE_CONTROL if (isTriggerErrorNow() || isIgnitionTimingError() || consoleByteArrived) { consoleByteArrived = false; enginePins.warningLedPin.setValue(1); @@ -643,7 +643,7 @@ static void blinkingThread(void *arg) { #endif /* EFI_PROD_CODE */ -#if EFI_LCD || defined(__DOXYGEN__) +#if EFI_LCD class LcdController : public PeriodicController { public: LcdController() : PeriodicController("BenchThread") { } @@ -662,20 +662,20 @@ private: static LcdController lcdInstance; #endif /* EFI_LCD */ -#if EFI_HIP_9011 || defined(__DOXYGEN__) +#if EFI_HIP_9011 extern HIP9011 instance; #endif /* EFI_HIP_9011 */ -#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ENGINE_PARAMETER_SUFFIX) { -#if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) +#if EFI_SHAFT_POSITION_INPUT int rpm = GET_RPM(); #else /* EFI_SHAFT_POSITION_INPUT */ int rpm = 0; #endif /* EFI_SHAFT_POSITION_INPUT */ -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE executorStatistics(); #endif /* EFI_PROD_CODE */ @@ -717,7 +717,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->vBatt = getVBatt(PASS_ENGINE_PARAMETER_SIGNATURE); } tsOutputChannels->tpsADC = getTPS12bitAdc(PASS_ENGINE_PARAMETER_SIGNATURE) / TPS_TS_CONVERSION; -#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) +#if EFI_ANALOG_SENSORS tsOutputChannels->baroPressure = hasBaroSensor() ? getBaroPressure() : 0; #endif /* EFI_ANALOG_SENSORS */ tsOutputChannels->engineLoad = engineLoad; @@ -747,7 +747,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->isWarnNow = engine->engineState.warnings.isWarningNow(timeSeconds, true); tsOutputChannels->isCltBroken = engine->isCltBroken; -#if EFI_HIP_9011 || defined(__DOXYGEN__) +#if EFI_HIP_9011 tsOutputChannels->isKnockChipOk = (instance.invalidHip9011ResponsesCount == 0); #endif /* EFI_HIP_9011 */ @@ -757,7 +757,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->debugIntField1 = atoi(VCS_VERSION); break; case DBG_METRICS: -#if EFI_CLOCK_LOCKS || defined(__DOXYGEN__) +#if EFI_CLOCK_LOCKS tsOutputChannels->debugIntField1 = maxLockedDuration; tsOutputChannels->debugIntField2 = maxTriggerReentraint; #endif /* EFI_CLOCK_LOCKS */ @@ -794,7 +794,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ } break; case DBG_FSIO_EXPRESSION: -#if EFI_PROD_CODE && EFI_FSIO || defined(__DOXYGEN__) +#if EFI_PROD_CODE && EFI_FSIO tsOutputChannels->debugFloatField1 = getFsioOutputValue(0 PASS_ENGINE_PARAMETER_SUFFIX); tsOutputChannels->debugFloatField2 = getFsioOutputValue(1 PASS_ENGINE_PARAMETER_SUFFIX); tsOutputChannels->debugFloatField3 = getFsioOutputValue(2 PASS_ENGINE_PARAMETER_SUFFIX); @@ -813,14 +813,14 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ case DBG_CRANKING_DETAILS: tsOutputChannels->debugIntField1 = engine->rpmCalculator.getRevolutionCounterSinceStart(); break; -#if EFI_HIP_9011 || defined(__DOXYGEN__) +#if EFI_HIP_9011 case DBG_KNOCK: // todo: maybe extract hipPostState(tsOutputChannels); tsOutputChannels->debugIntField1 = instance.correctResponsesCount; tsOutputChannels->debugIntField2 = instance.invalidHip9011ResponsesCount; break; #endif /* EFI_HIP_9011 */ -#if (EFI_CJ125 && HAL_USE_SPI) || defined(__DOXYGEN__) +#if EFI_CJ125 && HAL_USE_SPI case DBG_CJ125: cjPostState(tsOutputChannels); break; @@ -830,7 +830,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ postMapState(tsOutputChannels); break; #endif /* EFI_MAP_AVERAGING */ -#if EFI_CAN_SUPPORT || defined(__DOXYGEN__) +#if EFI_CAN_SUPPORT case DBG_CAN: postCanState(tsOutputChannels); break; @@ -883,7 +883,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->internalMcuTemperature = getMCUInternalTemperature(); #endif /* HAL_USE_ADC */ -#if EFI_MAX_31855 || defined(__DOXYGEN__) +#if EFI_MAX_31855 for (int i = 0; i < EGT_CHANNEL_COUNT; i++) tsOutputChannels->egtValues.values[i] = getEgtValue(i); #endif /* EFI_MAX_31855 */ @@ -892,14 +892,14 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->idlePosition = getIdlePosition(); #endif -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE tsOutputChannels->isTriggerError = isTriggerErrorNow(); -#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__) +#if EFI_INTERNAL_FLASH tsOutputChannels->needBurn = getNeedToWriteConfiguration(); #endif /* EFI_INTERNAL_FLASH */ -#if EFI_FILE_LOGGING || defined(__DOXYGEN__) +#if EFI_FILE_LOGGING tsOutputChannels->hasSdCard = isSdCardAlive(); #endif /* EFI_FILE_LOGGING */ @@ -911,7 +911,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->isCylinderCleanupEnabled = engineConfiguration->isCylinderCleanupEnabled; tsOutputChannels->isCylinderCleanupActivated = engine->isCylinderCleanupMode; tsOutputChannels->secondTriggerChannelEnabled = engineConfiguration->secondTriggerChannelEnabled; -#if EFI_VEHICLE_SPEED || defined(__DOXYGEN__) +#if EFI_VEHICLE_SPEED float vehicleSpeed = getVehicleSpeed(); tsOutputChannels->vehicleSpeedKph = vehicleSpeed; tsOutputChannels->speedToRpmRatio = vehicleSpeed / rpm; @@ -960,12 +960,12 @@ void initStatusLoop(void) { addConsoleActionI(FULL_LOGGING_KEY, setFullLog); addConsoleActionI("warn", setWarningEnabled); -#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) +#if EFI_ENGINE_CONTROL addConsoleActionFF("fuelinfo2", (VoidFloatFloat) showFuelInfo2); addConsoleAction("fuelinfo", showFuelInfo); #endif -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE addConsoleActionI("set_led_blinking_period", setBlinkingPeriod); @@ -975,11 +975,11 @@ void initStatusLoop(void) { void startStatusThreads(void) { // todo: refactoring needed, this file should probably be split into pieces -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE initStatusLeds(); chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, (tfunc_t) blinkingThread, NULL); #endif /* EFI_PROD_CODE */ -#if EFI_LCD || defined(__DOXYGEN__) +#if EFI_LCD lcdInstance.Start(); #endif /* EFI_LCD */ } diff --git a/firmware/development/engine_emulator.cpp b/firmware/development/engine_emulator.cpp index 83af8962de..ceb39f4bc4 100644 --- a/firmware/development/engine_emulator.cpp +++ b/firmware/development/engine_emulator.cpp @@ -99,7 +99,7 @@ void initEngineEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { return; #if EFI_POTENTIOMETER -#if HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI initPotentiometers(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); #endif /* HAL_USE_SPI */ #endif /* EFI_POTENTIOMETER */ diff --git a/firmware/development/engine_sniffer.cpp b/firmware/development/engine_sniffer.cpp index c1a5f5de86..a04ad650fc 100644 --- a/firmware/development/engine_sniffer.cpp +++ b/firmware/development/engine_sniffer.cpp @@ -28,7 +28,7 @@ #include "engine_sniffer.h" #include "adc_inputs.h" -#if EFI_ENGINE_SNIFFER || defined(__DOXYGEN__) +#if EFI_ENGINE_SNIFFER #include "engine_configuration.h" #include "eficonsole.h" @@ -36,7 +36,7 @@ #define CHART_DELIMETER '!' -#if EFI_HISTOGRAMS || defined(__DOXYGEN__) +#if EFI_HISTOGRAMS #include "rfiutil.h" #include "histogram.h" static histogram_s engineSnifferHisto; @@ -71,7 +71,7 @@ static LoggingWithStorage logger("wave info"); */ static uint32_t skipUntilEngineCycle = 0; -#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) +#if ! EFI_UNIT_TEST extern WaveChart waveChart; static void resetNow(void) { skipUntilEngineCycle = engine->rpmCalculator.getRevolutionCounter() + 3; @@ -114,7 +114,7 @@ static void printStatus(void) { static void setChartActive(int value) { engineConfiguration->isEngineChartEnabled = value; printStatus(); -#if EFI_CLOCK_LOCKS || defined(__DOXYGEN__) +#if EFI_CLOCK_LOCKS maxLockedDuration = 0; // todo: why do we reset this here? why only this and not all metrics? #endif /* EFI_CLOCK_LOCKS */ } @@ -163,7 +163,7 @@ void WaveChart::publish() { * @brief Register an event for digital sniffer */ void WaveChart::addEvent3(const char *name, const char * msg) { -#if EFI_TEXT_LOGGING || defined(__DOXYGEN__) +#if EFI_TEXT_LOGGING if (!ENGINE(isEngineChartEnabled)) { return; } @@ -237,7 +237,7 @@ void WaveChart::addEvent3(const char *name, const char * msg) { } void showWaveChartHistogram(void) { -#if (EFI_HISTOGRAMS && EFI_PROD_CODE) || defined(__DOXYGEN__) +#if EFI_HISTOGRAMS && EFI_PROD_CODE printHistogram(&logger, &engineSnifferHisto); #endif } @@ -250,17 +250,17 @@ void initWaveChart(WaveChart *chart) { printStatus(); -#if DEBUG_WAVE || defined(__DOXYGEN__) +#if DEBUG_WAVE initLoggingExt(&debugLogging, "wave chart debug", &debugLogging.DEFAULT_BUFFER, sizeof(debugLogging.DEFAULT_BUFFER)); #endif -#if EFI_HISTOGRAMS || defined(__DOXYGEN__) +#if EFI_HISTOGRAMS initHistogram(&engineSnifferHisto, "wave chart"); #endif /* EFI_HISTOGRAMS */ addConsoleActionI("chartsize", setChartSize); addConsoleActionI("chart", setChartActive); -#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) +#if ! EFI_UNIT_TEST addConsoleAction("reset_engine_chart", resetNow); #endif } diff --git a/firmware/development/engine_sniffer.h b/firmware/development/engine_sniffer.h index c36d9ddc21..a2e8241b18 100644 --- a/firmware/development/engine_sniffer.h +++ b/firmware/development/engine_sniffer.h @@ -11,7 +11,7 @@ #include "global.h" -#if EFI_ENGINE_SNIFFER || defined(__DOXYGEN__) +#if EFI_ENGINE_SNIFFER #include "datalogging.h" /** diff --git a/firmware/development/hw_layer/poten.cpp b/firmware/development/hw_layer/poten.cpp index baf7661d55..91e1084a82 100644 --- a/firmware/development/hw_layer/poten.cpp +++ b/firmware/development/hw_layer/poten.cpp @@ -15,7 +15,7 @@ #include "hardware.h" #include "mpu_util.h" -#if HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI EXTERN_ENGINE; @@ -52,7 +52,7 @@ EXTERN_ENGINE; static Logging * logger; -#if EFI_POTENTIOMETER || defined(__DOXYGEN__) +#if EFI_POTENTIOMETER static Mcp42010Driver potConfig[DIGIPOT_COUNT]; void initPotentiometer(Mcp42010Driver *driver, SPIDriver *spi, brain_pin_e csPin) { diff --git a/firmware/development/hw_layer/poten.h b/firmware/development/hw_layer/poten.h index f521a1c789..f2999327d3 100644 --- a/firmware/development/hw_layer/poten.h +++ b/firmware/development/hw_layer/poten.h @@ -11,7 +11,7 @@ #include "global.h" -#if HAL_USE_SPI || defined(__DOXYGEN__) +#if HAL_USE_SPI #include "engine_configuration.h" diff --git a/firmware/development/rfi_perftest.cpp b/firmware/development/rfi_perftest.cpp index 7f9c872e22..4cdcadcc98 100644 --- a/firmware/development/rfi_perftest.cpp +++ b/firmware/development/rfi_perftest.cpp @@ -17,7 +17,7 @@ #include "console_io.h" #include "engine.h" -#if EFI_PERF_METRICS || defined(__DOXYGEN__) +#if EFI_PERF_METRICS #include "test.h" static Logging* logger; @@ -261,7 +261,7 @@ static void runTests(const int count) { extern Overflow64Counter halTime; -#if EFI_RTC || defined(__DOXYGEN__) +#if EFI_RTC static int rtcStartTime; #endif @@ -271,7 +271,7 @@ static void timeInfo(void) { scheduleMsg(logger, "chTimeNow as seconds = %d", getTimeNowSeconds()); scheduleMsg(logger, "hal seconds = %d", halTime.get() / (long)CORE_CLOCK); -#if EFI_RTC || defined(__DOXYGEN__) +#if EFI_RTC int unix = rtcGetTimeUnixSec(&RTCD1) - rtcStartTime; scheduleMsg(logger, "unix seconds = %d", unix); #endif @@ -299,7 +299,7 @@ static void runChibioTest(void) { void initTimePerfActions(Logging *sharedLogger) { logger = sharedLogger; -#if EFI_RTC || defined(__DOXYGEN__) +#if EFI_RTC rtcStartTime = rtcGetTimeUnixSec(&RTCD1); #endif diff --git a/firmware/development/sensor_chart.cpp b/firmware/development/sensor_chart.cpp index cbd221028f..0d4ab3c217 100644 --- a/firmware/development/sensor_chart.cpp +++ b/firmware/development/sensor_chart.cpp @@ -10,10 +10,10 @@ #include "engine.h" #include "rpm_calculator.h" -#if EFI_SENSOR_CHART || defined(__DOXYGEN__) +#if EFI_SENSOR_CHART #include "status_loop.h" -#if EFI_TEXT_LOGGING || defined(__DOXYGEN__) +#if EFI_TEXT_LOGGING static char LOGGING_BUFFER[5000] CCM_OPTIONAL; static Logging scLogging("analog chart", LOGGING_BUFFER, sizeof(LOGGING_BUFFER)); #endif /* EFI_TEXT_LOGGING */ @@ -24,7 +24,7 @@ static int initialized = false; EXTERN_ENGINE; void scAddData(float angle, float value) { -#if EFI_TEXT_LOGGING || defined(__DOXYGEN__) +#if EFI_TEXT_LOGGING if (!initialized) { return; // this is possible because of initialization sequence } diff --git a/firmware/development/test/test.c b/firmware/development/test/test.c index 2f8b6430ec..6e4c23856a 100644 --- a/firmware/development/test/test.c +++ b/firmware/development/test/test.c @@ -24,7 +24,7 @@ #include "global.h" -#if EFI_PERF_METRICS || defined(__DOXYGEN__) +#if EFI_PERF_METRICS #include "test.h" #include "testbmk.h" diff --git a/firmware/development/test/test.h b/firmware/development/test/test.h index 0db2b572f7..28741c6537 100644 --- a/firmware/development/test/test.h +++ b/firmware/development/test/test.h @@ -28,14 +28,14 @@ /** * @brief Delay inserted between test cases. */ -#if !defined(DELAY_BETWEEN_TESTS) || defined(__DOXYGEN__) +#if !defined(DELAY_BETWEEN_TESTS) #define DELAY_BETWEEN_TESTS 200 #endif /** * @brief If @p TRUE then benchmarks are not included. */ -#if !defined(TEST_NO_BENCHMARKS) || defined(__DOXYGEN__) +#if !defined(TEST_NO_BENCHMARKS) #define TEST_NO_BENCHMARKS FALSE #endif diff --git a/firmware/development/test/testbmk.c b/firmware/development/test/testbmk.c index d0ed2eef88..5f6df1ae83 100644 --- a/firmware/development/test/testbmk.c +++ b/firmware/development/test/testbmk.c @@ -59,7 +59,7 @@ */ static Semaphore sem1; -#if CH_USE_MUTEXES || defined(__DOXYGEN__) +#if CH_USE_MUTEXES static Mutex mtx1; #endif @@ -443,7 +443,7 @@ ROMCONST struct testcase testbmk8 = { bmk8_execute }; -#if CH_USE_QUEUES || defined(__DOXYGEN__) +#if CH_USE_QUEUES /** * @page test_benchmarks_009 I/O Queues throughput * @@ -533,7 +533,7 @@ ROMCONST struct testcase testbmk10 = { bmk10_execute }; -#if CH_USE_SEMAPHORES || defined(__DOXYGEN__) +#if CH_USE_SEMAPHORES /** * @page test_benchmarks_011 Semaphores wait/signal performance * @@ -581,7 +581,7 @@ ROMCONST struct testcase testbmk11 = { }; #endif /* CH_USE_SEMAPHORES */ -#if CH_USE_MUTEXES || defined(__DOXYGEN__) +#if CH_USE_MUTEXES /** * @page test_benchmarks_012 Mutexes lock/unlock performance * @@ -651,12 +651,12 @@ static void bmk13_execute(void) { test_print("--- Timer : "); test_printn(sizeof(VirtualTimer)); test_println(" bytes"); -#if CH_USE_SEMAPHORES || defined(__DOXYGEN__) +#if CH_USE_SEMAPHORES test_print("--- Semaph: "); test_printn(sizeof(Semaphore)); test_println(" bytes"); #endif -#if CH_USE_EVENTS || defined(__DOXYGEN__) +#if CH_USE_EVENTS test_print("--- EventS: "); test_printn(sizeof(EventSource)); test_println(" bytes"); @@ -664,22 +664,22 @@ static void bmk13_execute(void) { test_printn(sizeof(EventListener)); test_println(" bytes"); #endif -#if CH_USE_MUTEXES || defined(__DOXYGEN__) +#if CH_USE_MUTEXES test_print("--- Mutex : "); test_printn(sizeof(Mutex)); test_println(" bytes"); #endif -#if CH_USE_CONDVARS || defined(__DOXYGEN__) +#if CH_USE_CONDVARS test_print("--- CondV.: "); test_printn(sizeof(CondVar)); test_println(" bytes"); #endif -#if CH_USE_QUEUES || defined(__DOXYGEN__) +#if CH_USE_QUEUES test_print("--- Queue : "); test_printn(sizeof(GenericQueue)); test_println(" bytes"); #endif -#if CH_USE_MAILBOXES || defined(__DOXYGEN__) +#if CH_USE_MAILBOXES test_print("--- MailB.: "); test_printn(sizeof(Mailbox)); test_println(" bytes"); @@ -706,14 +706,14 @@ ROMCONST struct testcase * ROMCONST patternbmk[] = { &testbmk6, &testbmk7, &testbmk8, -#if CH_USE_QUEUES || defined(__DOXYGEN__) +#if CH_USE_QUEUES &testbmk9, #endif &testbmk10, -#if CH_USE_SEMAPHORES || defined(__DOXYGEN__) +#if CH_USE_SEMAPHORES &testbmk11, #endif -#if CH_USE_MUTEXES || defined(__DOXYGEN__) +#if CH_USE_MUTEXES &testbmk12, #endif &testbmk13, diff --git a/firmware/development/trigger_emulator.cpp b/firmware/development/trigger_emulator.cpp index ce3b959072..55f910d080 100644 --- a/firmware/development/trigger_emulator.cpp +++ b/firmware/development/trigger_emulator.cpp @@ -17,7 +17,7 @@ #include "trigger_central.h" #include "settings.h" -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE #include "pwm_generator.h" #include "pin_repository.h" #endif /* EFI_PROD_CODE */ @@ -39,14 +39,14 @@ void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousCo void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { -#if EFI_EMULATE_POSITION_SENSORS || defined(__DOXYGEN__) +#if EFI_EMULATE_POSITION_SENSORS print("Emulating %s\r\n", getConfigurationName(engineConfiguration->engineType)); triggerSignal.outputPins[0] = &emulatorOutputs[0]; triggerSignal.outputPins[1] = &emulatorOutputs[1]; triggerSignal.outputPins[2] = &emulatorOutputs[2]; -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_PROD_CODE // todo: refactor, make this a loop triggerSignal.outputPins[0]->initPin("trg emulator ch1", CONFIGB(triggerSimulatorPins)[0], &CONFIGB(triggerSimulatorPinModes)[0]); diff --git a/firmware/development/wave_analyzer.cpp b/firmware/development/wave_analyzer.cpp index 88c482f528..91ea988464 100644 --- a/firmware/development/wave_analyzer.cpp +++ b/firmware/development/wave_analyzer.cpp @@ -26,14 +26,14 @@ #include "rpm_calculator.h" #include "engine_sniffer.h" -#if EFI_WAVE_ANALYZER || defined(__DOXYGEN__) +#if EFI_WAVE_ANALYZER EXTERN_ENGINE; #define CHART_RESET_DELAY 1 #define MAX_ICU_COUNT 5 -#if EFI_ENGINE_SNIFFER || defined(__DOXYGEN__) +#if EFI_ENGINE_SNIFFER extern WaveChart waveChart; #endif extern bool hasFirmwareErrorFlag; @@ -55,7 +55,7 @@ static void ensureInitialized(WaveReader *reader) { efiAssertVoid(CUSTOM_ERR_6654, reader->hw != NULL && reader->hw->started, "wave analyzer NOT INITIALIZED"); } -#if EFI_WAVE_ANALYZER || defined(__DOXYGEN__) +#if EFI_WAVE_ANALYZER static void waAnaWidthCallback(WaveReader *reader) { efitick_t nowUs = getTimeNowUs(); @@ -274,7 +274,7 @@ void initWaveAnalyzer(Logging *sharedLogger) { if (hasFirmwareError()) { return; } -#if EFI_WAVE_ANALYZER || defined(__DOXYGEN__) +#if EFI_WAVE_ANALYZER initWave(WA_CHANNEL_1, 0); initWave(WA_CHANNEL_2, 1); diff --git a/firmware/development/wave_analyzer.h b/firmware/development/wave_analyzer.h index 282da059b5..2166b36324 100644 --- a/firmware/development/wave_analyzer.h +++ b/firmware/development/wave_analyzer.h @@ -12,7 +12,7 @@ #include "global.h" -#if EFI_WAVE_ANALYZER || defined(__DOXYGEN__) +#if EFI_WAVE_ANALYZER #include "digital_input_hw.h" #include "engine_sniffer.h" diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index dc2224ab76..abb7bb0c4d 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -126,7 +126,7 @@ #include "lcd_HD44780.h" #endif /* EFI_HD44780_LCD */ -#if EFI_ENGINE_EMULATOR || defined(__DOXYGEN__) +#if EFI_ENGINE_EMULATOR #include "engine_emulator.h" #endif /* EFI_ENGINE_EMULATOR */ @@ -168,7 +168,7 @@ void runRusEfi(void) { initErrorHandling(); addConsoleAction("reboot", scheduleReboot); -#if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) +#if EFI_SHAFT_POSITION_INPUT /** * This is so early because we want to init logger * which would be used while finding trigger sync index @@ -187,7 +187,7 @@ void runRusEfi(void) { */ initPinRepository(); -#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__) +#if EFI_INTERNAL_FLASH /** * First thing is reading configuration from flash memory. * In order to have complete flexibility configuration has to go before anything else. @@ -215,11 +215,11 @@ void runRusEfi(void) { initEngineContoller(&sharedLogger PASS_ENGINE_PARAMETER_SIGNATURE); rememberCurrentConfiguration(); -#if EFI_PERF_METRICS || defined(__DOXYGEN__) +#if EFI_PERF_METRICS initTimePerfActions(&sharedLogger); #endif -#if EFI_ENGINE_EMULATOR || defined(__DOXYGEN__) +#if EFI_ENGINE_EMULATOR initEngineEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SIGNATURE); #endif startStatusThreads(); @@ -235,7 +235,7 @@ void runRusEfi(void) { while (true) { efiAssertVoid(CUSTOM_RM_STACK, getCurrentRemainingStack() > 128, "stack#1"); -#if (EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE) || defined(__DOXYGEN__) +#if EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE // sensor state + all pending messages for our own dev console updateDevConsoleState(); #endif /* EFI_CLI_SUPPORT */ @@ -256,7 +256,7 @@ void runRusEfi(void) { void chDbgStackOverflowPanic(thread_t *otp) { (void)otp; strcpy(panicMessage, "stack overflow: "); -#if defined(CH_USE_REGISTRY) || defined(__DOXYGEN__) +#if defined(CH_USE_REGISTRY) int p_name_len = strlen(otp->p_name); if (p_name_len < sizeof(panicMessage) - 2) strcat(panicMessage, otp->p_name); diff --git a/firmware/util/cli_registry.cpp b/firmware/util/cli_registry.cpp index 570c7e4ae9..5565efbb40 100644 --- a/firmware/util/cli_registry.cpp +++ b/firmware/util/cli_registry.cpp @@ -43,7 +43,7 @@ void resetConsoleActions(void) { } static void doAddAction(const char *token, action_type_e type, Void callback, void *param) { -#if !defined(EFI_DISABLE_CONSOLE_ACTIONS) || defined(__DOXYGEN__) +#if !defined(EFI_DISABLE_CONSOLE_ACTIONS) for (uint32_t i = 0; i < efiStrlen(token);i++) { char ch = token[i]; if (ch != mytolower(ch)) { @@ -168,14 +168,14 @@ static int getParameterCount(action_type_e parameterType) { * @brief This function prints out a list of all available commands */ void helpCommand(void) { -#if EFI_BOARD_TEST || defined(__DOXYGEN__) +#if EFI_BOARD_TEST if (isBoardTestMode()) { printBoardTestState(); return; } #endif /* EFI_BOARD_TEST */ -#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) +#if EFI_PROD_CODE || EFI_SIMULATOR scheduleMsg(logging, "%d actions available", consoleActionCount); for (int i = 0; i < consoleActionCount; i++) { TokenCallback *current = &consoleActions[i]; @@ -347,7 +347,7 @@ void handleActionWithParameter(TokenCallback *current, char *parameter) { REPLACE_SPACES_WITH_ZERO; int value1 = atoi(parameter); if (absI(value1) == ERROR_CODE) { -#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) +#if EFI_PROD_CODE || EFI_SIMULATOR scheduleMsg(logging, "not an integer [%s]", parameter); #endif return; @@ -355,7 +355,7 @@ void handleActionWithParameter(TokenCallback *current, char *parameter) { parameter += spaceIndex + 1; int value2 = atoi(parameter); if (absI(value2) == ERROR_CODE) { -#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) +#if EFI_PROD_CODE || EFI_SIMULATOR scheduleMsg(logging, "not an integer [%s]", parameter); #endif return; @@ -531,7 +531,7 @@ static bool handleConsoleLineInternal(const char *commandLine, int lineLength) { return false; } -#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) +#if EFI_PROD_CODE || EFI_SIMULATOR static void sendOutConfirmation(const char *command, int length) { scheduleMsg(logging, "%s%d", command, length); } @@ -561,7 +561,7 @@ void handleConsoleLine(char *line) { sendOutConfirmation(confirmation, lineLength); #endif -#if EFI_SIMULATOR || defined(__DOXYGEN__) +#if EFI_SIMULATOR printf("handleConsoleLine [%s]\r\n", line); #endif /* EFI_SIMULATOR */ diff --git a/firmware/util/datalogging.cpp b/firmware/util/datalogging.cpp index 691f1c765d..901e0b7086 100644 --- a/firmware/util/datalogging.cpp +++ b/firmware/util/datalogging.cpp @@ -32,7 +32,7 @@ #include "global.h" -#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) +#if ! EFI_UNIT_TEST #include "chprintf.h" #include "chmtx.h" #include "memstreams.h" diff --git a/firmware/util/loggingcentral.cpp b/firmware/util/loggingcentral.cpp index 28a4328ce3..38de539e81 100644 --- a/firmware/util/loggingcentral.cpp +++ b/firmware/util/loggingcentral.cpp @@ -8,7 +8,7 @@ #include "global.h" #include "efilib.h" -#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) +#if ! EFI_UNIT_TEST typedef char log_buf_t[DL_OUTPUT_BUFFER]; @@ -41,7 +41,7 @@ static char * outputBuffer; * of logging content */ void scheduleLogging(Logging *logging) { -#if EFI_TEXT_LOGGING || defined(__DOXYGEN__) +#if EFI_TEXT_LOGGING // this could be done without locking int newLength = efiStrlen(logging->buffer); @@ -71,7 +71,7 @@ void scheduleLogging(Logging *logging) { * this method should always be invoked from the same thread! */ char * swapOutputBuffers(int *actualOutputBufferSize) { -#if EFI_ENABLE_ASSERTS || defined(__DOXYGEN__) +#if EFI_ENABLE_ASSERTS int expectedOutputSize; #endif /* EFI_ENABLE_ASSERTS */ { // start of critical section @@ -81,7 +81,7 @@ char * swapOutputBuffers(int *actualOutputBufferSize) { */ char *temp = outputBuffer; -#if EFI_ENABLE_ASSERTS || defined(__DOXYGEN__) +#if EFI_ENABLE_ASSERTS expectedOutputSize = accumulatedSize; #endif /* EFI_ENABLE_ASSERTS */ outputBuffer = accumulationBuffer; @@ -96,7 +96,7 @@ char * swapOutputBuffers(int *actualOutputBufferSize) { } // end of critical section *actualOutputBufferSize = efiStrlen(outputBuffer); -#if EFI_ENABLE_ASSERTS || defined(__DOXYGEN__) +#if EFI_ENABLE_ASSERTS if (*actualOutputBufferSize != expectedOutputSize) { int sizeToShow = minI(10, *actualOutputBufferSize); int offsetToShow = *actualOutputBufferSize - sizeToShow; @@ -121,7 +121,7 @@ void initLoggingCentral(void) { * in order to reduce memory usage */ void scheduleMsg(Logging *logging, const char *fmt, ...) { -#if EFI_TEXT_LOGGING || defined(__DOXYGEN__) +#if EFI_TEXT_LOGGING if (logging == NULL) { warning(CUSTOM_ERR_LOGGING_NULL, "logging NULL"); return; diff --git a/firmware/util/math/interpolation.cpp b/firmware/util/math/interpolation.cpp index 685c8a59e5..d1533379af 100644 --- a/firmware/util/math/interpolation.cpp +++ b/firmware/util/math/interpolation.cpp @@ -211,7 +211,7 @@ int findIndexMsg(const char *msg, const float array[], int size, float value) { break; if (middle != 0 && array[middle - 1] > array[middle]) { -#if EFI_UNIT_TEST || defined(__DOXYGEN__) +#if EFI_UNIT_TEST firmwareError(CUSTOM_ERR_6610, "%s: out of order %.2f %.2f", msg, array[middle - 1], array[middle]); #else warning(CUSTOM_ERR_OUT_OF_ORDER, "%s: out of order %.2f %.2f", msg, array[middle - 1], array[middle]); diff --git a/firmware/util/math/pid.cpp b/firmware/util/math/pid.cpp index 40b95d844d..8514897686 100644 --- a/firmware/util/math/pid.cpp +++ b/firmware/util/math/pid.cpp @@ -110,7 +110,7 @@ void Pid::setErrorAmplification(float coef) { errorAmplificationCoef = coef; } -#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO void Pid::postState(TunerStudioOutputChannels *tsOutputChannels) { postState(tsOutputChannels, 1); } @@ -135,7 +135,7 @@ void Pid::postState(TunerStudioOutputChannels *tsOutputChannels, int pMult) { #endif /* EFI_TUNER_STUDIO */ void Pid::sleep() { -#if !EFI_UNIT_TEST || defined(__DOXYGEN__) +#if !EFI_UNIT_TEST int periodMs = maxI(10, pid->periodMs); chThdSleepMilliseconds(periodMs); #endif /* EFI_UNIT_TEST */ diff --git a/firmware/util/math/pid.h b/firmware/util/math/pid.h index aa8797e25f..7ea73ef038 100644 --- a/firmware/util/math/pid.h +++ b/firmware/util/math/pid.h @@ -45,7 +45,7 @@ public: float getIntegration(void); float getPrevError(void); void setErrorAmplification(float coef); -#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) +#if EFI_TUNER_STUDIO void postState(TunerStudioOutputChannels *tsOutputChannels); void postState(TunerStudioOutputChannels *tsOutputChannels, int pMult); #endif /* EFI_TUNER_STUDIO */ diff --git a/simulator/simulator/rusEfiFunctionalTest.cpp b/simulator/simulator/rusEfiFunctionalTest.cpp index 69f5443f59..57f8a97119 100644 --- a/simulator/simulator/rusEfiFunctionalTest.cpp +++ b/simulator/simulator/rusEfiFunctionalTest.cpp @@ -119,7 +119,7 @@ void rusEfiFunctionalTest(void) { initTriggerCentral(&sharedLogger); initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); -#if EFI_MAP_AVERAGING || defined(__DOXYGEN__) +#if EFI_MAP_AVERAGING initMapAveraging(&sharedLogger, engine); #endif /* EFI_MAP_AVERAGING */