From cb032fb1ea89d3bf5e5e1002f5b2d883fd54940a Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Mon, 15 Nov 2021 04:02:34 -0800 Subject: [PATCH] (void) -> () (#3550) * static functions with (void) * more * Revert "more" This reverts commit 246e53441f935451437df186ac92d7df26b62fb6. * s Co-authored-by: Matthew Kennedy --- firmware/bootloader/src/dfu.cpp | 14 +++++++------- .../boards/subaru_eg33/board_configuration.cpp | 2 +- firmware/console/binary/tunerstudio.cpp | 4 ++-- firmware/console/eficonsole.cpp | 8 ++++---- firmware/console/status_loop.cpp | 4 ++-- .../actuators/alternator_controller.cpp | 2 +- .../controllers/actuators/electronic_throttle.cpp | 2 +- firmware/controllers/core/fsio_impl.cpp | 2 +- firmware/controllers/engine_controller.cpp | 6 +++--- .../controllers/engine_cycle/map_averaging.cpp | 2 +- firmware/controllers/flash_main.cpp | 4 ++-- firmware/controllers/gauges/lcd_controller.cpp | 2 +- .../controllers/gauges/malfunction_indicator.cpp | 2 +- firmware/controllers/sensors/map.cpp | 2 +- firmware/controllers/settings.cpp | 10 +++++----- firmware/controllers/trigger/trigger_central.cpp | 2 +- firmware/development/engine_sniffer.cpp | 4 ++-- firmware/development/rfi_perftest.cpp | 4 ++-- firmware/hw_layer/adc/adc_inputs.cpp | 2 +- firmware/hw_layer/drivers/can/can_hw.cpp | 2 +- firmware/hw_layer/drivers/lcd/HD44780.cpp | 2 +- firmware/hw_layer/drivers/serial/serial_hw.cpp | 2 +- firmware/hw_layer/hardware.cpp | 2 +- firmware/hw_layer/mmc_card.cpp | 14 +++++++------- firmware/hw_layer/pin_repository.cpp | 2 +- firmware/hw_layer/ports/cypress/backup_ram.cpp | 2 +- firmware/hw_layer/ports/stm32/stm32f7/mpu_util.cpp | 4 ++-- firmware/hw_layer/rtc_helper.cpp | 2 +- firmware/hw_layer/sensors/cj125.cpp | 4 ++-- firmware/hw_layer/sensors/hip9011.cpp | 12 ++++++------ firmware/hw_layer/sensors/joystick.cpp | 2 +- firmware/hw_layer/sensors/max31855.cpp | 4 ++-- firmware/rusefi.cpp | 6 +++--- firmware/rusefi.h | 5 ++--- firmware/util/math/interpolation.cpp | 2 +- unit_tests/tests/trigger/test_trigger_decoder.cpp | 2 +- 36 files changed, 73 insertions(+), 74 deletions(-) diff --git a/firmware/bootloader/src/dfu.cpp b/firmware/bootloader/src/dfu.cpp index 630a7730d3..699baa7d7d 100644 --- a/firmware/bootloader/src/dfu.cpp +++ b/firmware/bootloader/src/dfu.cpp @@ -77,7 +77,7 @@ static uint16_t bufToInt16(uint8_t *buf) { return (buf[0] << 8) | buf[1]; } -static void prepareInterruptsForJump(void) { +static void prepareInterruptsForJump() { #ifdef STM32F4 // interrupt control SCB->ICSR &= ~SCB_ICSR_PENDSVSET_Msk; @@ -112,7 +112,7 @@ void dfuJumpToApp(uint32_t addr) { chSysHalt("dfuJumpToApp FAIL"); } -static void dfuHandleGetList(void) { +static void dfuHandleGetList() { static const uint8_t cmdsInfo[] = { DFU_VERSION_NUMBER, DFU_GET_LIST_CMD, DFU_DEVICE_ID_CMD, DFU_READ_CMD, DFU_GO_CMD, DFU_WRITE_CMD, DFU_ERASE_CMD }; size_t numBytes = sizeof(cmdsInfo); @@ -122,7 +122,7 @@ static void dfuHandleGetList(void) { sendByte(DFU_ACK_BYTE); } -static void dfuHandleDeviceId(void) { +static void dfuHandleDeviceId() { uint32_t mcuRev = getMcuRevision(); sendByte(0x01); // the number of bytes to be send - 1 // send 12 bit MCU revision @@ -131,7 +131,7 @@ static void dfuHandleDeviceId(void) { sendByte(DFU_ACK_BYTE); } -static void dfuHandleGo(void) { +static void dfuHandleGo() { uint32_t addr; if (!readAddress(&addr)) { @@ -143,7 +143,7 @@ static void dfuHandleGo(void) { dfuJumpToApp(addr); } -static void dfuHandleRead(void) { +static void dfuHandleRead() { uint32_t addr; if (!readAddress(&addr)) { @@ -174,7 +174,7 @@ static void dfuHandleRead(void) { blTsChannel.write(buffer, numBytes, true); } -static void dfuHandleWrite(void) { +static void dfuHandleWrite() { uint32_t addr; if (!readAddress(&addr)) { @@ -206,7 +206,7 @@ static void dfuHandleWrite(void) { sendByte(DFU_ACK_BYTE); } -static void dfuHandleErase(void) { +static void dfuHandleErase() { int numSectors; if (!getByte(buffer)) return; diff --git a/firmware/config/boards/subaru_eg33/board_configuration.cpp b/firmware/config/boards/subaru_eg33/board_configuration.cpp index 743733c483..432e75931e 100644 --- a/firmware/config/boards/subaru_eg33/board_configuration.cpp +++ b/firmware/config/boards/subaru_eg33/board_configuration.cpp @@ -331,7 +331,7 @@ static const struct mc33810_config mc33810_even = { .en = {.port = nullptr, .pad = 0} }; -static void board_init_ext_gpios(void) +static void board_init_ext_gpios() { int ret; diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index a06d0ffce5..828d811fc5 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -98,7 +98,7 @@ persistent_config_s configWorkingCopy; #endif /* EFI_NO_CONFIG_WORKING_COPY */ -static void printErrorCounters(void) { +static void printErrorCounters() { efiPrintf("TunerStudio size=%d / total=%d / errors=%d / H=%d / O=%d / P=%d / B=%d", sizeof(tsOutputChannels), tsState.totalCounter, tsState.errorCounter, tsState.queryCommandCounter, tsState.outputChannelsCommandCounter, tsState.readPageCommandsCounter, tsState.burnCommandCounter); @@ -115,7 +115,7 @@ extern persistent_config_container_s persistentState; static efitimems_t previousWriteReportMs = 0; -static void resetTs(void) { +static void resetTs() { memset(&tsState, 0, sizeof(tsState)); } diff --git a/firmware/console/eficonsole.cpp b/firmware/console/eficonsole.cpp index 8554a72d93..f67533bc73 100644 --- a/firmware/console/eficonsole.cpp +++ b/firmware/console/eficonsole.cpp @@ -28,15 +28,15 @@ #include "console_io.h" #include "svnversion.h" -static void testCritical(void) { +static void testCritical() { chDbgCheck(0); } -static void myerror(void) { +static void myerror() { firmwareError(CUSTOM_ERR_TEST_ERROR, "firmwareError: %d", getRusEfiVersion()); } -static void sayHello(void) { +static void sayHello() { efiPrintf(PROTOCOL_HELLO_PREFIX " rusEFI LLC (c) 2012-2021. All rights reserved."); efiPrintf(PROTOCOL_HELLO_PREFIX " rusEFI v%d@%s", getRusEfiVersion(), VCS_VERSION); efiPrintf(PROTOCOL_HELLO_PREFIX " Chibios Kernel: %s", CH_KERNEL_VERSION); @@ -156,7 +156,7 @@ int CountFreeStackSpace(const void* wabase) { /** * This methods prints all threads, their stack usage, and their total times */ -static void cmd_threads(void) { +static void cmd_threads() { #if CH_DBG_THREADS_PROFILING && CH_DBG_FILL_THREADS thread_t* tp = chRegFirstThread(); diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 1b8cff3380..43e431ba07 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -311,7 +311,7 @@ static void showFuelInfo2(float rpm, float engineLoad) { } #if EFI_ENGINE_CONTROL -static void showFuelInfo(void) { +static void showFuelInfo() { showFuelInfo2((float) GET_RPM(), getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE)); } #endif @@ -319,7 +319,7 @@ static void showFuelInfo(void) { static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin, &enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin }; -static void initStatusLeds(void) { +static void initStatusLeds() { enginePins.communicationLedPin.initPin("led: comm status", engineConfiguration->communicationLedPin, &LED_COMMUNICATION_BRAIN_PIN_MODE, true); // checkEnginePin is already initialized by the time we get here diff --git a/firmware/controllers/actuators/alternator_controller.cpp b/firmware/controllers/actuators/alternator_controller.cpp index cd0dd83e36..6c4cbed5f2 100644 --- a/firmware/controllers/actuators/alternator_controller.cpp +++ b/firmware/controllers/actuators/alternator_controller.cpp @@ -27,7 +27,7 @@ static percent_t currentAltDuty; static bool currentPlainOnOffState = false; static bool shouldResetPid = false; -static void pidReset(void) { +static void pidReset() { alternatorPid.reset(); } diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 75c6ec0bb3..891c737f5e 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -678,7 +678,7 @@ static EtbThread etbThread CCM_OPTIONAL; #endif -static void showEthInfo(void) { +static void showEthInfo() { #if EFI_PROD_CODE efiPrintf("etbAutoTune=%d", engine->etbAutoTune); diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 7f15e587fb..035594ddf5 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -252,7 +252,7 @@ static void showFsio(const char *msg, LEElement *element) { } // todo: move somewhere else -static void showFsioInfo(void) { +static void showFsioInfo() { #if EFI_PROD_CODE || EFI_SIMULATOR showFsio("fuel", fuelPumpLogic); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index c98900e10d..046376d740 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -181,7 +181,7 @@ efitimesec_t getTimeNowSeconds(void) { return getTimeNowUs() / US_PER_SECOND; } -static void resetAccel(void) { +static void resetAccel() { engine->tpsAccelEnrichment.resetAE(); for (size_t i = 0; i < efi::size(engine->injectionEvents.elements); i++) @@ -291,7 +291,7 @@ static void printAnalogChannelInfo(const char *name, adc_channel_e hwChannel) { #endif /* HAL_USE_ADC */ } -static void printAnalogInfo(void) { +static void printAnalogInfo() { efiPrintf("analogInputDividerCoefficient: %.2f", engineConfiguration->analogInputDividerCoefficient); printAnalogChannelInfo("hip9011", engineConfiguration->hipOutputChannel); @@ -470,7 +470,7 @@ static void setFloat(const char *offsetStr, const char *valueStr) { onConfigurationChanged(); } -static void initConfigActions(void) { +static void initConfigActions() { addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat); addConsoleActionII("set_int", (VoidIntInt) setInt); addConsoleActionII("set_short", (VoidIntInt) setShort); diff --git a/firmware/controllers/engine_cycle/map_averaging.cpp b/firmware/controllers/engine_cycle/map_averaging.cpp index f31cc84317..21a48e2530 100644 --- a/firmware/controllers/engine_cycle/map_averaging.cpp +++ b/firmware/controllers/engine_cycle/map_averaging.cpp @@ -293,7 +293,7 @@ void mapAveragingTriggerCallback( #endif } -static void showMapStats(void) { +static void showMapStats() { efiPrintf("per revolution %d", measurementsPerRevolution); } diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index bb80844adb..f244b03c26 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -211,7 +211,7 @@ static bool isValidCrc(persistent_config_container_s *state) { return isValidCrc_b; } -static void doResetConfiguration(void) { +static void doResetConfiguration() { resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX); } @@ -325,7 +325,7 @@ void readFromFlash() { } } -static void rewriteConfig(void) { +static void rewriteConfig() { doResetConfiguration(); writeToFlashNow(); } diff --git a/firmware/controllers/gauges/lcd_controller.cpp b/firmware/controllers/gauges/lcd_controller.cpp index 2764904df0..12b24fae50 100644 --- a/firmware/controllers/gauges/lcd_controller.cpp +++ b/firmware/controllers/gauges/lcd_controller.cpp @@ -243,7 +243,7 @@ static void showLine(lcd_line_e line, int /*screenY*/) { } } -static void fillWithSpaces(void) { +static void fillWithSpaces() { int column = getCurrentHD44780column(); for (int r = column; r < 20; r++) { lcd_HD44780_print_char(' '); diff --git a/firmware/controllers/gauges/malfunction_indicator.cpp b/firmware/controllers/gauges/malfunction_indicator.cpp index be3ecd427c..dd8aace235 100644 --- a/firmware/controllers/gauges/malfunction_indicator.cpp +++ b/firmware/controllers/gauges/malfunction_indicator.cpp @@ -106,7 +106,7 @@ private: static MILController instance CCM_OPTIONAL; #if TEST_MIL_CODE -static void testMil(void) { +static void testMil() { addError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction); addError(OBD_Intake_Air_Temperature_Circuit_Malfunction); } diff --git a/firmware/controllers/sensors/map.cpp b/firmware/controllers/sensors/map.cpp index 4a15a69424..61bdde3fd0 100644 --- a/firmware/controllers/sensors/map.cpp +++ b/firmware/controllers/sensors/map.cpp @@ -169,7 +169,7 @@ static void applyConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { extern int mapMinBufferLength; -static void printMAPInfo(void) { +static void printMAPInfo() { #if EFI_ANALOG_SENSORS efiPrintf("instant value=%.2fkPa", Sensor::getOrZero(SensorType::Map)); diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 4744114252..7bf2502e7f 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -245,7 +245,7 @@ void printTPSInfo(void) { printTpsSenser("TPS2", SensorType::Tps2, engineConfiguration->tps2Min, engineConfiguration->tps2Max, engineConfiguration->tps2_1AdcChannel); } -static void printTemperatureInfo(void) { +static void printTemperatureInfo() { #if EFI_ANALOG_SENSORS Sensor::showAllSensorInfo(); @@ -338,15 +338,15 @@ static void setIgnitionMode(int value) { doPrintConfiguration(); } -static void setOneCoilIgnition(void) { +static void setOneCoilIgnition() { setIgnitionMode((int)IM_ONE_COIL); } -static void setWastedIgnition(void) { +static void setWastedIgnition() { setIgnitionMode((int)IM_WASTED_SPARK); } -static void setIndividualCoilsIgnition(void) { +static void setIndividualCoilsIgnition() { setIgnitionMode((int)IM_INDIVIDUAL_COILS); } @@ -861,7 +861,7 @@ void scheduleStopEngine(void) { doScheduleStopEngine(PASS_ENGINE_PARAMETER_SIGNATURE); } -static void printAllInfo(void) { +static void printAllInfo() { printTemperatureInfo(); printTPSInfo(); #if EFI_ENGINE_SNIFFER diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index fbe210ec2d..8fdfc55dee 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -666,7 +666,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta } } -static void triggerShapeInfo(void) { +static void triggerShapeInfo() { #if EFI_PROD_CODE || EFI_SIMULATOR TriggerWaveform *shape = &engine->triggerCentral.triggerShape; TriggerFormDetails *triggerFormDetails = &engine->triggerCentral.triggerFormDetails; diff --git a/firmware/development/engine_sniffer.cpp b/firmware/development/engine_sniffer.cpp index 980c8905eb..27cd1ef049 100644 --- a/firmware/development/engine_sniffer.cpp +++ b/firmware/development/engine_sniffer.cpp @@ -60,7 +60,7 @@ static uint32_t skipUntilEngineCycle = 0; #if ! EFI_UNIT_TEST extern WaveChart waveChart; -static void resetNow(void) { +static void resetNow() { skipUntilEngineCycle = getRevolutionCounter() + 3; waveChart.reset(); } @@ -109,7 +109,7 @@ int WaveChart::getSize() { } #if ! EFI_UNIT_TEST -static void printStatus(void) { +static void printStatus() { efiPrintf("engine chart: %s", boolToString(engineConfiguration->isEngineChartEnabled)); efiPrintf("engine chart size=%d", engineConfiguration->engineChartSize); } diff --git a/firmware/development/rfi_perftest.cpp b/firmware/development/rfi_perftest.cpp index dfbe6e5c7e..45fc52ddd1 100644 --- a/firmware/development/rfi_perftest.cpp +++ b/firmware/development/rfi_perftest.cpp @@ -262,7 +262,7 @@ static int rtcStartTime; #include "chrtclib.h" -static void timeInfo(void) { +static void timeInfo() { efiPrintf("chTimeNow as seconds = %d", getTimeNowSeconds()); efiPrintf("hal seconds = %d", halTime.get() / (long)CORE_CLOCK); @@ -272,7 +272,7 @@ static void timeInfo(void) { #endif } -static void runChibioTest(void) { +static void runChibioTest() { print("EFI_SHAFT_POSITION_INPUT=%d\r\n", EFI_SHAFT_POSITION_INPUT); print("EFI_EMULATE_POSITION_SENSORS=%d\r\n", EFI_EMULATE_POSITION_SENSORS); print("EFI_ANALOG_SENSORS=%d\r\n", EFI_ANALOG_SENSORS); diff --git a/firmware/hw_layer/adc/adc_inputs.cpp b/firmware/hw_layer/adc/adc_inputs.cpp index 5d4cfdc0e6..413ef78790 100644 --- a/firmware/hw_layer/adc/adc_inputs.cpp +++ b/firmware/hw_layer/adc/adc_inputs.cpp @@ -432,7 +432,7 @@ void removeChannel(const char *name, adc_channel_e setting) { // Weak link a stub so that every board doesn't have to implement this function __attribute__((weak)) void setAdcChannelOverrides() { } -static void configureInputs(void) { +static void configureInputs() { memset(adcHwChannelEnabled, 0, sizeof(adcHwChannelEnabled)); /** diff --git a/firmware/hw_layer/drivers/can/can_hw.cpp b/firmware/hw_layer/drivers/can/can_hw.cpp index 3beeac78ef..9ea6719c25 100644 --- a/firmware/hw_layer/drivers/can/can_hw.cpp +++ b/firmware/hw_layer/drivers/can/can_hw.cpp @@ -162,7 +162,7 @@ private: static CanRead canRead CCM_OPTIONAL; static CanWrite canWrite CCM_OPTIONAL; -static void canInfo(void) { +static void canInfo() { if (!isCanEnabled) { efiPrintf("CAN is not enabled, please enable & restart"); return; diff --git a/firmware/hw_layer/drivers/lcd/HD44780.cpp b/firmware/hw_layer/drivers/lcd/HD44780.cpp index dec2b6482e..cf7736e8f0 100644 --- a/firmware/hw_layer/drivers/lcd/HD44780.cpp +++ b/firmware/hw_layer/drivers/lcd/HD44780.cpp @@ -68,7 +68,7 @@ static void lcdSleep(int period) { //static char txbuf[1]; #define LCD_PORT_EXP_ADDR 0x20 -static bool lcd_HD44780_is_enabled(void) { +static bool lcd_HD44780_is_enabled() { /* check for valid LCD setting */ return ((engineConfiguration->displayMode == DM_HD44780) && (isBrainPinValid(CONFIG(HD44780_rs))) && diff --git a/firmware/hw_layer/drivers/serial/serial_hw.cpp b/firmware/hw_layer/drivers/serial/serial_hw.cpp index 35d7ffc3e2..095264f25e 100644 --- a/firmware/hw_layer/drivers/serial/serial_hw.cpp +++ b/firmware/hw_layer/drivers/serial/serial_hw.cpp @@ -22,7 +22,7 @@ static bool isSerialRXEnabled = false; static SerialConfig uartCfg; static SerialRead serialRead; -static void auxInfo(void) { +static void auxInfo() { if (!isSerialEnabled) { efiPrintf("AUX Serial is not enabled, please enable & restart"); return; diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 4ba8dc55e3..3007d8cea1 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -198,7 +198,7 @@ void onFastAdcComplete(adcsample_t*) { } #endif /* HAL_USE_ADC */ -static void calcFastAdcIndexes(void) { +static void calcFastAdcIndexes() { #if HAL_USE_ADC fastMapSampleIndex = enableFastAdcChannel("Fast MAP", engineConfiguration->map.sensor.hwChannel); hipSampleIndex = enableFastAdcChannel("HIP9011", engineConfiguration->hipOutputChannel); diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index 897868b8d4..cc226a5ebe 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -89,7 +89,7 @@ static NO_CACHE FATFS MMC_FS; static int fatFsErrors = 0; -static void mmcUnMount(void); +static void mmcUnMount(); static void setSdCardReady(bool value) { fs_ready = value; @@ -112,7 +112,7 @@ static FIL FDLogFile NO_CACHE; static int logFileIndex = MIN_FILE_INDEX; static char logName[_MAX_FILLER + 20]; -static void printMmcPinout(void) { +static void printMmcPinout() { efiPrintf("MMC CS %s", hwPortname(CONFIG(sdCardCsPin))); // todo: we need to figure out the right SPI pinout, not just SPI2 // efiPrintf("MMC SCK %s:%d", portname(EFI_SPI2_SCK_PORT), EFI_SPI2_SCK_PIN); @@ -120,7 +120,7 @@ static void printMmcPinout(void) { // efiPrintf("MMC MOSI %s:%d", portname(EFI_SPI2_MOSI_PORT), EFI_SPI2_MOSI_PIN); } -static void sdStatistics(void) { +static void sdStatistics() { printMmcPinout(); efiPrintf("SD enabled=%s status=%s", boolToString(CONFIG(isSdCardEnabled)), sdStatus); @@ -130,7 +130,7 @@ static void sdStatistics(void) { } } -static void incLogFileName(void) { +static void incLogFileName() { memset(&FDLogFile, 0, sizeof(FIL)); // clear the memory FRESULT err = f_open(&FDLogFile, LOG_INDEX_FILENAME, FA_READ); // This file has the index for next log file name @@ -164,7 +164,7 @@ static void incLogFileName(void) { efiPrintf("Done %d", logFileIndex); } -static void prepareLogFileName(void) { +static void prepareLogFileName() { strcpy(logName, RUSEFI_LOG_PREFIX); char *ptr; @@ -190,7 +190,7 @@ static void prepareLogFileName(void) { * This function saves the name of the file in a global variable * so that we can later append to that file */ -static void createLogFile(void) { +static void createLogFile() { memset(&FDLogFile, 0, sizeof(FIL)); // clear the memory prepareLogFileName(); @@ -282,7 +282,7 @@ static void listDirectory(const char *path) { /* * MMC card un-mount. */ -static void mmcUnMount(void) { +static void mmcUnMount() { if (!isSdCardAlive()) { efiPrintf("Error: No File system is mounted. \"mountsd\" first"); return; diff --git a/firmware/hw_layer/pin_repository.cpp b/firmware/hw_layer/pin_repository.cpp index 003e5712a1..1388b6255a 100644 --- a/firmware/hw_layer/pin_repository.cpp +++ b/firmware/hw_layer/pin_repository.cpp @@ -120,7 +120,7 @@ static brain_pin_e index_to_brainPin(unsigned int i) return GPIO_INVALID; } -static void reportPins(void) { +static void reportPins() { for (unsigned int i = 0; i < getBrainPinOnchipNum(); i++) { const char *pin_user = getBrainUsedPin(i); diff --git a/firmware/hw_layer/ports/cypress/backup_ram.cpp b/firmware/hw_layer/ports/cypress/backup_ram.cpp index 2166dd6f12..da55b5429e 100644 --- a/firmware/hw_layer/ports/cypress/backup_ram.cpp +++ b/firmware/hw_layer/ports/cypress/backup_ram.cpp @@ -20,7 +20,7 @@ static bool wasLoaded = false; static const int backupStateOffset = 0, backupDataOffset = 1; const size_t backupSize = (BACKUP_RAM_NUM + 1) * sizeof(uint32_t); -static void backupInit(void) { +static void backupInit() { static_assert(backupSize <= BACKUP_FLASH_SIZE, "Backup flash overflow"); // first, load the whole buffer into the memory diff --git a/firmware/hw_layer/ports/stm32/stm32f7/mpu_util.cpp b/firmware/hw_layer/ports/stm32/stm32f7/mpu_util.cpp index 286723d7ba..831e674f74 100644 --- a/firmware/hw_layer/ports/stm32/stm32f7/mpu_util.cpp +++ b/firmware/hw_layer/ports/stm32/stm32f7/mpu_util.cpp @@ -134,12 +134,12 @@ uintptr_t getFlashAddrSecondCopy() { #define FLASH_OPTKEY1 (0x08192A3B) #define FLASH_OPTKEY2 (0x4C5D6E7F) -static void flash_wait_complete(void) +static void flash_wait_complete() { do { __DSB(); } while (FLASH->SR & FLASH_SR_BSY); } -static void stm32f7_flash_mass_erase_dual_block(void) +static void stm32f7_flash_mass_erase_dual_block() { FLASH_CR |= FLASH_CR_MER1 | FLASH_CR_MER2; FLASH_CR |= FLASH_CR_STRT; diff --git a/firmware/hw_layer/rtc_helper.cpp b/firmware/hw_layer/rtc_helper.cpp index 098a4f01ac..9b67ac1eed 100644 --- a/firmware/hw_layer/rtc_helper.cpp +++ b/firmware/hw_layer/rtc_helper.cpp @@ -47,7 +47,7 @@ extern "C" int _gettimeofday(timeval* tv, void* tzvp) { #endif #if EFI_RTC -static time_t GetTimeUnixSec(void) { +static time_t GetTimeUnixSec() { struct tm tim; rtcGetTime(&RTCD1, ×pec); diff --git a/firmware/hw_layer/sensors/cj125.cpp b/firmware/hw_layer/sensors/cj125.cpp index 588389c542..2c9922e4fe 100644 --- a/firmware/hw_layer/sensors/cj125.cpp +++ b/firmware/hw_layer/sensors/cj125.cpp @@ -501,7 +501,7 @@ static bool cj125periodic(CJ125 *instance DECLARE_ENGINE_PARAMETER_SUFFIX) { #if ! EFI_UNIT_TEST -static msg_t cjThread(void) +static msg_t cjThread() { chRegSetThreadName("cj125"); @@ -516,7 +516,7 @@ static msg_t cjThread(void) return -1; } -static bool cjCheckConfig(void) { +static bool cjCheckConfig() { if (!CONFIG(isCJ125Enabled)) { efiPrintf("cj125 is disabled. Failed!"); return false; diff --git a/firmware/hw_layer/sensors/hip9011.cpp b/firmware/hw_layer/sensors/hip9011.cpp index f378f6b632..57333f77f7 100644 --- a/firmware/hw_layer/sensors/hip9011.cpp +++ b/firmware/hw_layer/sensors/hip9011.cpp @@ -114,7 +114,7 @@ static SPIConfig hipSpiCfg = { /*==========================================================================*/ #if EFI_HIP_9011_DEBUG - static void hip_addconsoleActions(void); + static void hip_addconsoleActions(); #endif /*==========================================================================*/ @@ -203,7 +203,7 @@ int Hip9011Hardware::sendSyncCommand(uint8_t tx, uint8_t *rx_ptr) { return ret; } -static int hip_wake_driver(void) +static int hip_wake_driver() { /* Entering a reentrant critical zone.*/ syssts_t sts = chSysGetStatusAndLockX(); @@ -328,7 +328,7 @@ void hipAdcCallback(adcsample_t adcValue) { } } -static int hip_testAdvMode(void) { +static int hip_testAdvMode() { int ret; uint8_t ret0, ret1, ret2; @@ -362,7 +362,7 @@ static int hip_testAdvMode(void) { return -1; } -static int hip_init(void) { +static int hip_init() { int ret; ret = instance.hw->sendSyncCommand(SET_PRESCALER_CMD(instance.prescaler), NULL); @@ -582,7 +582,7 @@ static const char *hip_state_names[] = "Waiting for second ADC sample" }; -static void showHipInfo(void) { +static void showHipInfo() { if (!CONFIG(isHip9011Enabled)) { efiPrintf("hip9011 driver not active"); return; @@ -670,7 +670,7 @@ static void setHipGain(float value) { showHipInfo(); } -static void hip_addconsoleActions(void) { +static void hip_addconsoleActions() { addConsoleAction("hipinfo", showHipInfo); addConsoleActionF("set_gain", setHipGain); addConsoleActionF("set_band", setHipBand); diff --git a/firmware/hw_layer/sensors/joystick.cpp b/firmware/hw_layer/sensors/joystick.cpp index e160f40afd..5e72088867 100644 --- a/firmware/hw_layer/sensors/joystick.cpp +++ b/firmware/hw_layer/sensors/joystick.cpp @@ -73,7 +73,7 @@ static void extCallback(ioportmask_t channel) { #endif } -static void joystickInfo(void) { +static void joystickInfo() { efiPrintf("total %d center=%d@%s", joyTotal, joyCenter, hwPortname(CONFIG(joystickCenterPin))); efiPrintf("a=%d@%s", joyA, hwPortname(CONFIG(joystickAPin))); diff --git a/firmware/hw_layer/sensors/max31855.cpp b/firmware/hw_layer/sensors/max31855.cpp index c9cf1c6aea..d38a52bded 100644 --- a/firmware/hw_layer/sensors/max31855.cpp +++ b/firmware/hw_layer/sensors/max31855.cpp @@ -29,7 +29,7 @@ static SPIDriver *driver; static SPIConfig spiConfig[EGT_CHANNEL_COUNT]; -static void showEgtInfo(void) { +static void showEgtInfo() { #if EFI_PROD_CODE printSpiState(engineConfiguration); @@ -111,7 +111,7 @@ uint16_t getEgtValue(int egtChannel) { } } -static void egtRead(void) { +static void egtRead() { if (driver == NULL) { efiPrintf("No SPI selected for EGT"); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 3a6039436a..381ff51bc5 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -138,7 +138,7 @@ static char panicMessage[200]; static virtual_timer_t resetTimer; // todo: move this into a hw-specific file -void rebootNow(void) { +void rebootNow() { NVIC_SystemReset(); } @@ -146,7 +146,7 @@ void rebootNow(void) { * Some configuration changes require full firmware reset. * Once day we will write graceful shutdown, but that would be one day. */ -static void scheduleReboot(void) { +static void scheduleReboot() { efiPrintf("Rebooting in 3 seconds..."); chibios_rt::CriticalSectionLocker csl; chVTSetI(&resetTimer, TIME_MS2I(3000), (vtfunc_t) rebootNow, NULL); @@ -162,7 +162,7 @@ void onAssertionFailure() { void runRusEfiWithConfig(); void runMainLoop(); -void runRusEfi(void) { +void runRusEfi() { efiAssertVoid(CUSTOM_RM_STACK_1, getCurrentRemainingStack() > 512, "init s"); assertEngineReference(); engine->setConfig(); diff --git a/firmware/rusefi.h b/firmware/rusefi.h index 1406b29f5a..c4fb86bc48 100644 --- a/firmware/rusefi.h +++ b/firmware/rusefi.h @@ -7,6 +7,5 @@ #pragma once -void runRusEfi(void); -void rebootNow(void); - +void runRusEfi(); +void rebootNow(); diff --git a/firmware/util/math/interpolation.cpp b/firmware/util/math/interpolation.cpp index d16797724d..20f1619a59 100644 --- a/firmware/util/math/interpolation.cpp +++ b/firmware/util/math/interpolation.cpp @@ -22,7 +22,7 @@ float array16[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; -static void testBinary(void) { +static void testBinary() { const int size16 = 16; uint32_t totalOld = 0; diff --git a/unit_tests/tests/trigger/test_trigger_decoder.cpp b/unit_tests/tests/trigger/test_trigger_decoder.cpp index 8b2ee59c98..d0ba852b95 100644 --- a/unit_tests/tests/trigger/test_trigger_decoder.cpp +++ b/unit_tests/tests/trigger/test_trigger_decoder.cpp @@ -55,7 +55,7 @@ TEST(misc, testSkipped2_0) { ASSERT_EQ( 0, GET_RPM()) << "testNoStartUpWarnings RPM"; } -static void testDodgeNeonDecoder(void) { +static void testDodgeNeonDecoder() { printf("*************************************************** testDodgeNeonDecoder95\r\n"); ASSERT_EQ( 8, getTriggerZeroEventIndex(DODGE_NEON_1995)) << "DODGE_NEON_1995: trigger zero index";