From e58e3dd214c1e4ca8fb570c0b7b7886a0599de68 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 20:57:46 -0600 Subject: [PATCH 01/12] clangd/clang says ... controllers/actuators/electronic_throttle_impl.h|13 col 1-20 warning| Included header sensor.h is not used directly (fix available) controllers/actuators/electronic_throttle_impl.h|81 col 2-12 error| Unknown type name 'SensorType' (fix available) controllers/actuators/electronic_throttle_impl.h|94 col 2-7 error| Unknown type name 'Timer' (fix available) --- firmware/controllers/actuators/electronic_throttle_impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/actuators/electronic_throttle_impl.h b/firmware/controllers/actuators/electronic_throttle_impl.h index b977d15dcc..b79d5df8bf 100644 --- a/firmware/controllers/actuators/electronic_throttle_impl.h +++ b/firmware/controllers/actuators/electronic_throttle_impl.h @@ -10,9 +10,10 @@ // include the "public" ETB interface #include "electronic_throttle.h" -#include "sensor.h" #include "efi_pid.h" #include "electronic_throttle_generated.h" +#include "sensor_type.h" +#include "timer.h" /** * Hard code ETB update speed. From 3028dc92483b699c5d6bb4a6abbb8b18cc3c2823 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 20:58:21 -0600 Subject: [PATCH 02/12] clangd/clang says ... controllers/algo/rusefi_hw_enums.h|23 col 19-27 error| Unknown type name 'uint16_t' (fixes available) --- firmware/controllers/algo/rusefi_hw_enums.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/controllers/algo/rusefi_hw_enums.h b/firmware/controllers/algo/rusefi_hw_enums.h index 2e8f1c57a8..2c641c12a2 100644 --- a/firmware/controllers/algo/rusefi_hw_enums.h +++ b/firmware/controllers/algo/rusefi_hw_enums.h @@ -7,6 +7,8 @@ #pragma once +#include + // todo: migrate/unify with pin_output_mode_e? rename? something is messy here // this enum is currently only used for SPI pins typedef enum __attribute__ ((__packed__)) { From 5d43ada5b787da3f5b5ee71f2cf4ec4196232c93 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 20:59:52 -0600 Subject: [PATCH 03/12] clangd/clang says ... util/efilib.h|105 col 35-39 error| Unknown type name 'Gpio' (fix available) util/efilib.h|110 col 10-14 error| Use of undeclared identifier 'Gpio' (fix available) --- firmware/util/efilib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/util/efilib.h b/firmware/util/efilib.h index 1da3092cf4..354355c039 100644 --- a/firmware/util/efilib.h +++ b/firmware/util/efilib.h @@ -9,6 +9,7 @@ #include #include +#include "rusefi_hw_enums.h" int djb2lowerCase(const char *str); From 0552f80dbb14ca84a40b043c0fd9c931eb73104e Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 21:07:11 -0600 Subject: [PATCH 04/12] clangd/clang says ... init/sensor/init_lambda.cpp|6 col 1-23 warning| Included header live_data.h is not used directly (fix available) --- firmware/init/sensor/init_lambda.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/firmware/init/sensor/init_lambda.cpp b/firmware/init/sensor/init_lambda.cpp index d6c4788b31..e33517d829 100644 --- a/firmware/init/sensor/init_lambda.cpp +++ b/firmware/init/sensor/init_lambda.cpp @@ -3,7 +3,6 @@ #include "init.h" #include "adc_subscription.h" #include "linear_func.h" -#include "live_data.h" static LinearFunc func; From 2be064cb272da3735fdc2c62f948e478131d9cef Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 21:09:04 -0600 Subject: [PATCH 05/12] clangd/clang says ... controllers/math/engine_math.cpp|24 col 1-28 warning| Included header event_registry.h is not used directly (fixes available) controllers/math/engine_math.cpp|25 col 1-23 warning| Included header fuel_math.h is not used directly (fixes available) --- firmware/controllers/math/engine_math.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 2e3063f82a..e6dcfefd28 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -21,8 +21,6 @@ #include "pch.h" -#include "event_registry.h" -#include "fuel_math.h" #include "advance_map.h" #include "gppwm_channel.h" From 96e7ce03330d148cddde8c0f99b92cd8daa46178 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 21:10:15 -0600 Subject: [PATCH 06/12] clangd/clang says ... controllers/algo/fuel_math.cpp|33 col 1-27 warning| Included header speed_density.h is not used directly (fix available) --- firmware/controllers/algo/fuel_math.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 4eacac2509..f58aac5ac7 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -30,7 +30,6 @@ #include "fuel_math.h" #include "fuel_computer.h" #include "injector_model.h" -#include "speed_density.h" #include "speed_density_base.h" #include "lua_hooks.h" From 58200d89250bc2af2bcebbdacdd46d893d4c1b5d Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 21:35:07 -0600 Subject: [PATCH 07/12] clangd/clang says ... init/sensor/init_tps.cpp|9 col 1-35 warning| Included header auto_generated_sensor.h is not used directly (fix available) --- firmware/init/sensor/init_tps.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/init/sensor/init_tps.cpp b/firmware/init/sensor/init_tps.cpp index cc163858e4..02215e4b46 100644 --- a/firmware/init/sensor/init_tps.cpp +++ b/firmware/init/sensor/init_tps.cpp @@ -6,7 +6,9 @@ #include "proxy_sensor.h" #include "linear_func.h" #include "tps.h" +#if EFI_UNIT_TEST #include "auto_generated_sensor.h" +#endif #ifndef MAX_TPS_PPS_DISCREPANCY #define MAX_TPS_PPS_DISCREPANCY 5.0f From 874fb8695f5a70bb32a4bb91ca96532f99ce3e43 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 22:02:09 -0600 Subject: [PATCH 08/12] whitespace --- firmware/config/boards/proteus/knock_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/config/boards/proteus/knock_config.h b/firmware/config/boards/proteus/knock_config.h index 7edc5b1f5c..c1e113ed8d 100644 --- a/firmware/config/boards/proteus/knock_config.h +++ b/firmware/config/boards/proteus/knock_config.h @@ -30,4 +30,4 @@ #define KNOCK_SAMPLE_TIME ADC_SAMPLE_84 #define KNOCK_SAMPLE_RATE (STM32_PCLK2 / (4 * (84 + 12))) -#endif \ No newline at end of file +#endif From 65f8d4fb3bfd3fd783e00a6078fb8a41f1c699e3 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 22:03:47 -0600 Subject: [PATCH 09/12] clangd/clang says ... controllers/engine_cycle/knock_logic.h|15 col 36-48 error| Expected class name (fix available) controllers/engine_cycle/knock_logic.h|35 col 31-36 error| Use of undeclared identifier MS2NT (fix available) --- firmware/controllers/engine_cycle/knock_logic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/controllers/engine_cycle/knock_logic.h b/firmware/controllers/engine_cycle/knock_logic.h index b5b604a84d..6ce8163621 100644 --- a/firmware/controllers/engine_cycle/knock_logic.h +++ b/firmware/controllers/engine_cycle/knock_logic.h @@ -7,6 +7,8 @@ #pragma once +#include "efitime.h" +#include "engine_module.h" #include "peak_detect.h" #include "knock_controller_generated.h" From c956f28579ba56b1daa0b751b38d845a0791c3b8 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 22:03:58 -0600 Subject: [PATCH 10/12] whitespace --- firmware/controllers/sensors/impl/software_knock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/controllers/sensors/impl/software_knock.cpp b/firmware/controllers/sensors/impl/software_knock.cpp index 6e28d7a482..4ca8545fc6 100644 --- a/firmware/controllers/sensors/impl/software_knock.cpp +++ b/firmware/controllers/sensors/impl/software_knock.cpp @@ -98,7 +98,7 @@ void initSoftwareKnock() { knockFilter.configureBandpass(KNOCK_SAMPLE_RATE, 1000 * freqKhz, 3); efiSetPadMode("knock ch1", KNOCK_PIN_CH1, PAL_MODE_INPUT_ANALOG); -#if KNOCK_HAS_CH2 +#if KNOCK_HAS_CH2 efiSetPadMode("knock ch2", KNOCK_PIN_CH2, PAL_MODE_INPUT_ANALOG); #endif kt.start(); From 0c1f799889868d94f53db77aeb9daaed6514f06d Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 22:04:33 -0600 Subject: [PATCH 11/12] clangd/clang says ... controllers/sensors/impl/software_knock.cpp|98 col 33-50 warning| Result of integer division used in a floating point context; possible loss of precision --- firmware/controllers/sensors/impl/software_knock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/controllers/sensors/impl/software_knock.cpp b/firmware/controllers/sensors/impl/software_knock.cpp index 4ca8545fc6..5ce276371b 100644 --- a/firmware/controllers/sensors/impl/software_knock.cpp +++ b/firmware/controllers/sensors/impl/software_knock.cpp @@ -95,7 +95,7 @@ void initSoftwareKnock() { efiPrintf("Knock sense configuring filter with frequency %.2f khz", freqKhz); - knockFilter.configureBandpass(KNOCK_SAMPLE_RATE, 1000 * freqKhz, 3); + knockFilter.configureBandpass((int)KNOCK_SAMPLE_RATE, 1000 * freqKhz, 3); efiSetPadMode("knock ch1", KNOCK_PIN_CH1, PAL_MODE_INPUT_ANALOG); #if KNOCK_HAS_CH2 From 991f9dde9edf76b58d2ee05787567b2debccd920 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Dec 2024 22:05:31 -0600 Subject: [PATCH 12/12] clangd/clang says ... controllers/system/thread_controller.h|18 col 33-43 error| Use of undeclared identifier 'chibios_rt' (fix available) controllers/system/thread_controller.h|18 col 45-61 error| Unknown template name 'BaseStaticThread' controllers/system/thread_controller.h|21 col 8-15 error| Unknown type name 'tprio_t' (fix available) controllers/system/thread_controller.h|28 col 14-22 error| Only virtual member functions can be marked 'override' (fix available) controllers/system/thread_controller.h|29 col 9-16 error| No member named 'setName' in 'ThreadController' controllers/system/thread_controller.h|37 col 37-44 error| Unknown type name 'tprio_t' (fix available) controllers/system/thread_controller.h|51 col 4-14 error| Use of undeclared identifier 'chibios_rt' (fix available) controllers/system/thread_controller.h|51 col 44-46 error| No member named 'start' in the global namespace; did you mean simply 'start'? (fix available) --- firmware/controllers/system/thread_controller.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/controllers/system/thread_controller.h b/firmware/controllers/system/thread_controller.h index 1c78a3cdf6..5e1bb3d358 100644 --- a/firmware/controllers/system/thread_controller.h +++ b/firmware/controllers/system/thread_controller.h @@ -7,6 +7,8 @@ #pragma once +#include "global.h" + /** * @brief A base class for a controller that requires its own thread. *