(void) -> () (#3550)

* static functions with (void)

* more

* Revert "more"

This reverts commit 246e53441f.

* s

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2021-11-15 04:02:34 -08:00 committed by GitHub
parent 145316c497
commit cb032fb1ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 73 additions and 74 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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));
}

View File

@ -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();

View File

@ -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

View File

@ -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();
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -293,7 +293,7 @@ void mapAveragingTriggerCallback(
#endif
}
static void showMapStats(void) {
static void showMapStats() {
efiPrintf("per revolution %d", measurementsPerRevolution);
}

View File

@ -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();
}

View File

@ -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(' ');

View File

@ -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);
}

View File

@ -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));

View File

@ -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

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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));
/**

View File

@ -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;

View File

@ -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))) &&

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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, &timespec);

View File

@ -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;

View File

@ -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);

View File

@ -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)));

View File

@ -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");

View File

@ -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();

View File

@ -7,6 +7,5 @@
#pragma once
void runRusEfi(void);
void rebootNow(void);
void runRusEfi();
void rebootNow();

View File

@ -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;

View File

@ -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";