From 4f334c91d5c61466d91e2d2b44b64cedc3678d8e Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 20 May 2020 22:08:07 -0700 Subject: [PATCH] warnings (#1462) Co-authored-by: Matthew Kennedy --- .../actuators/electronic_throttle.cpp | 2 +- firmware/controllers/engine_controller.cpp | 4 +-- firmware/controllers/settings.cpp | 27 ++----------------- firmware/hw_layer/mc33816.cpp | 9 ++++--- firmware/hw_layer/mc33816.h | 2 -- 5 files changed, 10 insertions(+), 34 deletions(-) diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index e9edc7a154..c2ca6b579d 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -350,7 +350,7 @@ void EtbController::setOutput(expected outputValue) { } } -void EtbController::update(efitick_t nowNt) { +void EtbController::update(efitick_t) { #if EFI_TUNER_STUDIO // Only debug throttle #0 if (m_myIndex == 0) { diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index e2ebeeff03..53729cb74f 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -275,13 +275,13 @@ char * getPinNameByAdcChannel(const char *msg, adc_channel_e hwChannel, char *bu if (hwChannel == EFI_ADC_NONE) { strcpy(buffer, "NONE"); } else { - strcpy((char*) buffer, portname(getAdcChannelPort(msg, hwChannel))); + strcpy(buffer, portname(getAdcChannelPort(msg, hwChannel))); itoa10(&buffer[2], getAdcChannelPin(hwChannel)); } #else strcpy(buffer, "NONE"); #endif /* HAL_USE_ADC */ - return (char*) buffer; + return buffer; } static char pinNameBuffer[16]; diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index c89ecf4e2d..05cdb12956 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -371,30 +371,6 @@ static void setOperationMode(int value) { doPrintConfiguration(); } -static char pinNameBuffer[16]; - -static void printThermistor(const char *msg, ThermistorConf *config, ThermistorMath *tm, bool useLinear) { - adc_channel_e adcChannel = config->adcChannel; - float voltage = getVoltageDivided("term", adcChannel PASS_ENGINE_PARAMETER_SUFFIX); - float r = getResistance(config, voltage); - - float t = getTemperatureC(config, tm, useLinear); - - thermistor_conf_s *tc = &config->config; - - scheduleMsg(&logger, "%s volts=%.2f Celsius=%.2f sensorR=%.2f on channel %d", msg, voltage, t, r, adcChannel); - scheduleMsg(&logger, "@%s", getPinNameByAdcChannel(msg, adcChannel, pinNameBuffer)); - scheduleMsg(&logger, "C=%.2f/R=%.2f C=%.2f/R=%.2f C=%.2f/R=%.2f", - tc->tempC_1, tc->resistance_1, - tc->tempC_2, tc->resistance_2, - tc->tempC_3, tc->resistance_3); - - // %.5f - scheduleMsg(&logger, "bias resistor=%.2fK A=%.5f B=%.5f C=%.5f", tc->bias_resistor / 1000, - tm->s_h_a, tm->s_h_b, tm->s_h_c); - scheduleMsg(&logger, "=============================="); -} - static void printTpsSenser(const char *msg, SensorType sensor, int16_t min, int16_t max, adc_channel_e channel) { auto tps = Sensor::get(sensor); auto raw = Sensor::getRaw(sensor); @@ -402,7 +378,8 @@ static void printTpsSenser(const char *msg, SensorType sensor, int16_t min, int1 if (!tps.Valid) { scheduleMsg(&logger, "TPS not valid"); } - static char pinNameBuffer[16]; + + char pinNameBuffer[16]; scheduleMsg(&logger, "tps min (closed) %d/max (full) %d v=%.2f @%s", min, max, raw, getPinNameByAdcChannel(msg, channel, pinNameBuffer)); diff --git a/firmware/hw_layer/mc33816.cpp b/firmware/hw_layer/mc33816.cpp index 4d73dbfaa2..152733f14b 100644 --- a/firmware/hw_layer/mc33816.cpp +++ b/firmware/hw_layer/mc33816.cpp @@ -469,6 +469,11 @@ void initMc33816(Logging *sharedLogger) { mcRestart(); } +static void mcShutdown() { + driven.setValue(0); // ensure HV is off + resetB.setValue(0); // turn off the chip +} + static void mcRestart() { flag0before = false; flag0after = false; @@ -566,8 +571,4 @@ static void mcRestart() { } } -static void mcShutdown() { - driven.setValue(0); // ensure HV is off - resetB.setValue(0); // turn off the chip -} #endif /* EFI_MC33816 */ diff --git a/firmware/hw_layer/mc33816.h b/firmware/hw_layer/mc33816.h index f4f00ebaaf..f1352ffd8f 100644 --- a/firmware/hw_layer/mc33816.h +++ b/firmware/hw_layer/mc33816.h @@ -27,5 +27,3 @@ enum { }; void initMc33816(Logging *logger); -static void mcShutdown(); -