mirror of https://github.com/rusefi/rusefi.git
(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:
parent
145316c497
commit
cb032fb1ea
|
@ -77,7 +77,7 @@ static uint16_t bufToInt16(uint8_t *buf) {
|
||||||
return (buf[0] << 8) | buf[1];
|
return (buf[0] << 8) | buf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prepareInterruptsForJump(void) {
|
static void prepareInterruptsForJump() {
|
||||||
#ifdef STM32F4
|
#ifdef STM32F4
|
||||||
// interrupt control
|
// interrupt control
|
||||||
SCB->ICSR &= ~SCB_ICSR_PENDSVSET_Msk;
|
SCB->ICSR &= ~SCB_ICSR_PENDSVSET_Msk;
|
||||||
|
@ -112,7 +112,7 @@ void dfuJumpToApp(uint32_t addr) {
|
||||||
chSysHalt("dfuJumpToApp FAIL");
|
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,
|
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 };
|
DFU_WRITE_CMD, DFU_ERASE_CMD };
|
||||||
size_t numBytes = sizeof(cmdsInfo);
|
size_t numBytes = sizeof(cmdsInfo);
|
||||||
|
@ -122,7 +122,7 @@ static void dfuHandleGetList(void) {
|
||||||
sendByte(DFU_ACK_BYTE);
|
sendByte(DFU_ACK_BYTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dfuHandleDeviceId(void) {
|
static void dfuHandleDeviceId() {
|
||||||
uint32_t mcuRev = getMcuRevision();
|
uint32_t mcuRev = getMcuRevision();
|
||||||
sendByte(0x01); // the number of bytes to be send - 1
|
sendByte(0x01); // the number of bytes to be send - 1
|
||||||
// send 12 bit MCU revision
|
// send 12 bit MCU revision
|
||||||
|
@ -131,7 +131,7 @@ static void dfuHandleDeviceId(void) {
|
||||||
sendByte(DFU_ACK_BYTE);
|
sendByte(DFU_ACK_BYTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dfuHandleGo(void) {
|
static void dfuHandleGo() {
|
||||||
uint32_t addr;
|
uint32_t addr;
|
||||||
|
|
||||||
if (!readAddress(&addr)) {
|
if (!readAddress(&addr)) {
|
||||||
|
@ -143,7 +143,7 @@ static void dfuHandleGo(void) {
|
||||||
dfuJumpToApp(addr);
|
dfuJumpToApp(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dfuHandleRead(void) {
|
static void dfuHandleRead() {
|
||||||
uint32_t addr;
|
uint32_t addr;
|
||||||
|
|
||||||
if (!readAddress(&addr)) {
|
if (!readAddress(&addr)) {
|
||||||
|
@ -174,7 +174,7 @@ static void dfuHandleRead(void) {
|
||||||
blTsChannel.write(buffer, numBytes, true);
|
blTsChannel.write(buffer, numBytes, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dfuHandleWrite(void) {
|
static void dfuHandleWrite() {
|
||||||
uint32_t addr;
|
uint32_t addr;
|
||||||
|
|
||||||
if (!readAddress(&addr)) {
|
if (!readAddress(&addr)) {
|
||||||
|
@ -206,7 +206,7 @@ static void dfuHandleWrite(void) {
|
||||||
sendByte(DFU_ACK_BYTE);
|
sendByte(DFU_ACK_BYTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dfuHandleErase(void) {
|
static void dfuHandleErase() {
|
||||||
int numSectors;
|
int numSectors;
|
||||||
if (!getByte(buffer))
|
if (!getByte(buffer))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -331,7 +331,7 @@ static const struct mc33810_config mc33810_even = {
|
||||||
.en = {.port = nullptr, .pad = 0}
|
.en = {.port = nullptr, .pad = 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void board_init_ext_gpios(void)
|
static void board_init_ext_gpios()
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ persistent_config_s configWorkingCopy;
|
||||||
|
|
||||||
#endif /* EFI_NO_CONFIG_WORKING_COPY */
|
#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",
|
efiPrintf("TunerStudio size=%d / total=%d / errors=%d / H=%d / O=%d / P=%d / B=%d",
|
||||||
sizeof(tsOutputChannels), tsState.totalCounter, tsState.errorCounter, tsState.queryCommandCounter,
|
sizeof(tsOutputChannels), tsState.totalCounter, tsState.errorCounter, tsState.queryCommandCounter,
|
||||||
tsState.outputChannelsCommandCounter, tsState.readPageCommandsCounter, tsState.burnCommandCounter);
|
tsState.outputChannelsCommandCounter, tsState.readPageCommandsCounter, tsState.burnCommandCounter);
|
||||||
|
@ -115,7 +115,7 @@ extern persistent_config_container_s persistentState;
|
||||||
|
|
||||||
static efitimems_t previousWriteReportMs = 0;
|
static efitimems_t previousWriteReportMs = 0;
|
||||||
|
|
||||||
static void resetTs(void) {
|
static void resetTs() {
|
||||||
memset(&tsState, 0, sizeof(tsState));
|
memset(&tsState, 0, sizeof(tsState));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,15 +28,15 @@
|
||||||
#include "console_io.h"
|
#include "console_io.h"
|
||||||
#include "svnversion.h"
|
#include "svnversion.h"
|
||||||
|
|
||||||
static void testCritical(void) {
|
static void testCritical() {
|
||||||
chDbgCheck(0);
|
chDbgCheck(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void myerror(void) {
|
static void myerror() {
|
||||||
firmwareError(CUSTOM_ERR_TEST_ERROR, "firmwareError: %d", getRusEfiVersion());
|
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 LLC (c) 2012-2021. All rights reserved.");
|
||||||
efiPrintf(PROTOCOL_HELLO_PREFIX " rusEFI v%d@%s", getRusEfiVersion(), VCS_VERSION);
|
efiPrintf(PROTOCOL_HELLO_PREFIX " rusEFI v%d@%s", getRusEfiVersion(), VCS_VERSION);
|
||||||
efiPrintf(PROTOCOL_HELLO_PREFIX " Chibios Kernel: %s", CH_KERNEL_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
|
* 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
|
#if CH_DBG_THREADS_PROFILING && CH_DBG_FILL_THREADS
|
||||||
|
|
||||||
thread_t* tp = chRegFirstThread();
|
thread_t* tp = chRegFirstThread();
|
||||||
|
|
|
@ -311,7 +311,7 @@ static void showFuelInfo2(float rpm, float engineLoad) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
static void showFuelInfo(void) {
|
static void showFuelInfo() {
|
||||||
showFuelInfo2((float) GET_RPM(), getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE));
|
showFuelInfo2((float) GET_RPM(), getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -319,7 +319,7 @@ static void showFuelInfo(void) {
|
||||||
static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin,
|
static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin,
|
||||||
&enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin };
|
&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);
|
enginePins.communicationLedPin.initPin("led: comm status", engineConfiguration->communicationLedPin, &LED_COMMUNICATION_BRAIN_PIN_MODE, true);
|
||||||
// checkEnginePin is already initialized by the time we get here
|
// checkEnginePin is already initialized by the time we get here
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ static percent_t currentAltDuty;
|
||||||
static bool currentPlainOnOffState = false;
|
static bool currentPlainOnOffState = false;
|
||||||
static bool shouldResetPid = false;
|
static bool shouldResetPid = false;
|
||||||
|
|
||||||
static void pidReset(void) {
|
static void pidReset() {
|
||||||
alternatorPid.reset();
|
alternatorPid.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -678,7 +678,7 @@ static EtbThread etbThread CCM_OPTIONAL;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void showEthInfo(void) {
|
static void showEthInfo() {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
efiPrintf("etbAutoTune=%d",
|
efiPrintf("etbAutoTune=%d",
|
||||||
engine->etbAutoTune);
|
engine->etbAutoTune);
|
||||||
|
|
|
@ -252,7 +252,7 @@ static void showFsio(const char *msg, LEElement *element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: move somewhere else
|
// todo: move somewhere else
|
||||||
static void showFsioInfo(void) {
|
static void showFsioInfo() {
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
showFsio("fuel", fuelPumpLogic);
|
showFsio("fuel", fuelPumpLogic);
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ efitimesec_t getTimeNowSeconds(void) {
|
||||||
return getTimeNowUs() / US_PER_SECOND;
|
return getTimeNowUs() / US_PER_SECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resetAccel(void) {
|
static void resetAccel() {
|
||||||
engine->tpsAccelEnrichment.resetAE();
|
engine->tpsAccelEnrichment.resetAE();
|
||||||
|
|
||||||
for (size_t i = 0; i < efi::size(engine->injectionEvents.elements); i++)
|
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 */
|
#endif /* HAL_USE_ADC */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printAnalogInfo(void) {
|
static void printAnalogInfo() {
|
||||||
efiPrintf("analogInputDividerCoefficient: %.2f", engineConfiguration->analogInputDividerCoefficient);
|
efiPrintf("analogInputDividerCoefficient: %.2f", engineConfiguration->analogInputDividerCoefficient);
|
||||||
|
|
||||||
printAnalogChannelInfo("hip9011", engineConfiguration->hipOutputChannel);
|
printAnalogChannelInfo("hip9011", engineConfiguration->hipOutputChannel);
|
||||||
|
@ -470,7 +470,7 @@ static void setFloat(const char *offsetStr, const char *valueStr) {
|
||||||
onConfigurationChanged();
|
onConfigurationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initConfigActions(void) {
|
static void initConfigActions() {
|
||||||
addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat);
|
addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat);
|
||||||
addConsoleActionII("set_int", (VoidIntInt) setInt);
|
addConsoleActionII("set_int", (VoidIntInt) setInt);
|
||||||
addConsoleActionII("set_short", (VoidIntInt) setShort);
|
addConsoleActionII("set_short", (VoidIntInt) setShort);
|
||||||
|
|
|
@ -293,7 +293,7 @@ void mapAveragingTriggerCallback(
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void showMapStats(void) {
|
static void showMapStats() {
|
||||||
efiPrintf("per revolution %d", measurementsPerRevolution);
|
efiPrintf("per revolution %d", measurementsPerRevolution);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ static bool isValidCrc(persistent_config_container_s *state) {
|
||||||
return isValidCrc_b;
|
return isValidCrc_b;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void doResetConfiguration(void) {
|
static void doResetConfiguration() {
|
||||||
resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ void readFromFlash() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rewriteConfig(void) {
|
static void rewriteConfig() {
|
||||||
doResetConfiguration();
|
doResetConfiguration();
|
||||||
writeToFlashNow();
|
writeToFlashNow();
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,7 @@ static void showLine(lcd_line_e line, int /*screenY*/) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fillWithSpaces(void) {
|
static void fillWithSpaces() {
|
||||||
int column = getCurrentHD44780column();
|
int column = getCurrentHD44780column();
|
||||||
for (int r = column; r < 20; r++) {
|
for (int r = column; r < 20; r++) {
|
||||||
lcd_HD44780_print_char(' ');
|
lcd_HD44780_print_char(' ');
|
||||||
|
|
|
@ -106,7 +106,7 @@ private:
|
||||||
static MILController instance CCM_OPTIONAL;
|
static MILController instance CCM_OPTIONAL;
|
||||||
|
|
||||||
#if TEST_MIL_CODE
|
#if TEST_MIL_CODE
|
||||||
static void testMil(void) {
|
static void testMil() {
|
||||||
addError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
|
addError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
|
||||||
addError(OBD_Intake_Air_Temperature_Circuit_Malfunction);
|
addError(OBD_Intake_Air_Temperature_Circuit_Malfunction);
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ static void applyConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
extern int mapMinBufferLength;
|
extern int mapMinBufferLength;
|
||||||
|
|
||||||
static void printMAPInfo(void) {
|
static void printMAPInfo() {
|
||||||
#if EFI_ANALOG_SENSORS
|
#if EFI_ANALOG_SENSORS
|
||||||
efiPrintf("instant value=%.2fkPa", Sensor::getOrZero(SensorType::Map));
|
efiPrintf("instant value=%.2fkPa", Sensor::getOrZero(SensorType::Map));
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ void printTPSInfo(void) {
|
||||||
printTpsSenser("TPS2", SensorType::Tps2, engineConfiguration->tps2Min, engineConfiguration->tps2Max, engineConfiguration->tps2_1AdcChannel);
|
printTpsSenser("TPS2", SensorType::Tps2, engineConfiguration->tps2Min, engineConfiguration->tps2Max, engineConfiguration->tps2_1AdcChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printTemperatureInfo(void) {
|
static void printTemperatureInfo() {
|
||||||
#if EFI_ANALOG_SENSORS
|
#if EFI_ANALOG_SENSORS
|
||||||
Sensor::showAllSensorInfo();
|
Sensor::showAllSensorInfo();
|
||||||
|
|
||||||
|
@ -338,15 +338,15 @@ static void setIgnitionMode(int value) {
|
||||||
doPrintConfiguration();
|
doPrintConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setOneCoilIgnition(void) {
|
static void setOneCoilIgnition() {
|
||||||
setIgnitionMode((int)IM_ONE_COIL);
|
setIgnitionMode((int)IM_ONE_COIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setWastedIgnition(void) {
|
static void setWastedIgnition() {
|
||||||
setIgnitionMode((int)IM_WASTED_SPARK);
|
setIgnitionMode((int)IM_WASTED_SPARK);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setIndividualCoilsIgnition(void) {
|
static void setIndividualCoilsIgnition() {
|
||||||
setIgnitionMode((int)IM_INDIVIDUAL_COILS);
|
setIgnitionMode((int)IM_INDIVIDUAL_COILS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,7 +861,7 @@ void scheduleStopEngine(void) {
|
||||||
doScheduleStopEngine(PASS_ENGINE_PARAMETER_SIGNATURE);
|
doScheduleStopEngine(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printAllInfo(void) {
|
static void printAllInfo() {
|
||||||
printTemperatureInfo();
|
printTemperatureInfo();
|
||||||
printTPSInfo();
|
printTPSInfo();
|
||||||
#if EFI_ENGINE_SNIFFER
|
#if EFI_ENGINE_SNIFFER
|
||||||
|
|
|
@ -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
|
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||||
TriggerWaveform *shape = &engine->triggerCentral.triggerShape;
|
TriggerWaveform *shape = &engine->triggerCentral.triggerShape;
|
||||||
TriggerFormDetails *triggerFormDetails = &engine->triggerCentral.triggerFormDetails;
|
TriggerFormDetails *triggerFormDetails = &engine->triggerCentral.triggerFormDetails;
|
||||||
|
|
|
@ -60,7 +60,7 @@ static uint32_t skipUntilEngineCycle = 0;
|
||||||
|
|
||||||
#if ! EFI_UNIT_TEST
|
#if ! EFI_UNIT_TEST
|
||||||
extern WaveChart waveChart;
|
extern WaveChart waveChart;
|
||||||
static void resetNow(void) {
|
static void resetNow() {
|
||||||
skipUntilEngineCycle = getRevolutionCounter() + 3;
|
skipUntilEngineCycle = getRevolutionCounter() + 3;
|
||||||
waveChart.reset();
|
waveChart.reset();
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ int WaveChart::getSize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ! EFI_UNIT_TEST
|
#if ! EFI_UNIT_TEST
|
||||||
static void printStatus(void) {
|
static void printStatus() {
|
||||||
efiPrintf("engine chart: %s", boolToString(engineConfiguration->isEngineChartEnabled));
|
efiPrintf("engine chart: %s", boolToString(engineConfiguration->isEngineChartEnabled));
|
||||||
efiPrintf("engine chart size=%d", engineConfiguration->engineChartSize);
|
efiPrintf("engine chart size=%d", engineConfiguration->engineChartSize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,7 +262,7 @@ static int rtcStartTime;
|
||||||
|
|
||||||
#include "chrtclib.h"
|
#include "chrtclib.h"
|
||||||
|
|
||||||
static void timeInfo(void) {
|
static void timeInfo() {
|
||||||
efiPrintf("chTimeNow as seconds = %d", getTimeNowSeconds());
|
efiPrintf("chTimeNow as seconds = %d", getTimeNowSeconds());
|
||||||
efiPrintf("hal seconds = %d", halTime.get() / (long)CORE_CLOCK);
|
efiPrintf("hal seconds = %d", halTime.get() / (long)CORE_CLOCK);
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ static void timeInfo(void) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void runChibioTest(void) {
|
static void runChibioTest() {
|
||||||
print("EFI_SHAFT_POSITION_INPUT=%d\r\n", EFI_SHAFT_POSITION_INPUT);
|
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_EMULATE_POSITION_SENSORS=%d\r\n", EFI_EMULATE_POSITION_SENSORS);
|
||||||
print("EFI_ANALOG_SENSORS=%d\r\n", EFI_ANALOG_SENSORS);
|
print("EFI_ANALOG_SENSORS=%d\r\n", EFI_ANALOG_SENSORS);
|
||||||
|
|
|
@ -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
|
// Weak link a stub so that every board doesn't have to implement this function
|
||||||
__attribute__((weak)) void setAdcChannelOverrides() { }
|
__attribute__((weak)) void setAdcChannelOverrides() { }
|
||||||
|
|
||||||
static void configureInputs(void) {
|
static void configureInputs() {
|
||||||
memset(adcHwChannelEnabled, 0, sizeof(adcHwChannelEnabled));
|
memset(adcHwChannelEnabled, 0, sizeof(adcHwChannelEnabled));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -162,7 +162,7 @@ private:
|
||||||
static CanRead canRead CCM_OPTIONAL;
|
static CanRead canRead CCM_OPTIONAL;
|
||||||
static CanWrite canWrite CCM_OPTIONAL;
|
static CanWrite canWrite CCM_OPTIONAL;
|
||||||
|
|
||||||
static void canInfo(void) {
|
static void canInfo() {
|
||||||
if (!isCanEnabled) {
|
if (!isCanEnabled) {
|
||||||
efiPrintf("CAN is not enabled, please enable & restart");
|
efiPrintf("CAN is not enabled, please enable & restart");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -68,7 +68,7 @@ static void lcdSleep(int period) {
|
||||||
//static char txbuf[1];
|
//static char txbuf[1];
|
||||||
#define LCD_PORT_EXP_ADDR 0x20
|
#define LCD_PORT_EXP_ADDR 0x20
|
||||||
|
|
||||||
static bool lcd_HD44780_is_enabled(void) {
|
static bool lcd_HD44780_is_enabled() {
|
||||||
/* check for valid LCD setting */
|
/* check for valid LCD setting */
|
||||||
return ((engineConfiguration->displayMode == DM_HD44780) &&
|
return ((engineConfiguration->displayMode == DM_HD44780) &&
|
||||||
(isBrainPinValid(CONFIG(HD44780_rs))) &&
|
(isBrainPinValid(CONFIG(HD44780_rs))) &&
|
||||||
|
|
|
@ -22,7 +22,7 @@ static bool isSerialRXEnabled = false;
|
||||||
static SerialConfig uartCfg;
|
static SerialConfig uartCfg;
|
||||||
static SerialRead serialRead;
|
static SerialRead serialRead;
|
||||||
|
|
||||||
static void auxInfo(void) {
|
static void auxInfo() {
|
||||||
if (!isSerialEnabled) {
|
if (!isSerialEnabled) {
|
||||||
efiPrintf("AUX Serial is not enabled, please enable & restart");
|
efiPrintf("AUX Serial is not enabled, please enable & restart");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -198,7 +198,7 @@ void onFastAdcComplete(adcsample_t*) {
|
||||||
}
|
}
|
||||||
#endif /* HAL_USE_ADC */
|
#endif /* HAL_USE_ADC */
|
||||||
|
|
||||||
static void calcFastAdcIndexes(void) {
|
static void calcFastAdcIndexes() {
|
||||||
#if HAL_USE_ADC
|
#if HAL_USE_ADC
|
||||||
fastMapSampleIndex = enableFastAdcChannel("Fast MAP", engineConfiguration->map.sensor.hwChannel);
|
fastMapSampleIndex = enableFastAdcChannel("Fast MAP", engineConfiguration->map.sensor.hwChannel);
|
||||||
hipSampleIndex = enableFastAdcChannel("HIP9011", engineConfiguration->hipOutputChannel);
|
hipSampleIndex = enableFastAdcChannel("HIP9011", engineConfiguration->hipOutputChannel);
|
||||||
|
|
|
@ -89,7 +89,7 @@ static NO_CACHE FATFS MMC_FS;
|
||||||
|
|
||||||
static int fatFsErrors = 0;
|
static int fatFsErrors = 0;
|
||||||
|
|
||||||
static void mmcUnMount(void);
|
static void mmcUnMount();
|
||||||
|
|
||||||
static void setSdCardReady(bool value) {
|
static void setSdCardReady(bool value) {
|
||||||
fs_ready = value;
|
fs_ready = value;
|
||||||
|
@ -112,7 +112,7 @@ static FIL FDLogFile NO_CACHE;
|
||||||
static int logFileIndex = MIN_FILE_INDEX;
|
static int logFileIndex = MIN_FILE_INDEX;
|
||||||
static char logName[_MAX_FILLER + 20];
|
static char logName[_MAX_FILLER + 20];
|
||||||
|
|
||||||
static void printMmcPinout(void) {
|
static void printMmcPinout() {
|
||||||
efiPrintf("MMC CS %s", hwPortname(CONFIG(sdCardCsPin)));
|
efiPrintf("MMC CS %s", hwPortname(CONFIG(sdCardCsPin)));
|
||||||
// todo: we need to figure out the right SPI pinout, not just SPI2
|
// 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);
|
// 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);
|
// efiPrintf("MMC MOSI %s:%d", portname(EFI_SPI2_MOSI_PORT), EFI_SPI2_MOSI_PIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdStatistics(void) {
|
static void sdStatistics() {
|
||||||
printMmcPinout();
|
printMmcPinout();
|
||||||
efiPrintf("SD enabled=%s status=%s", boolToString(CONFIG(isSdCardEnabled)),
|
efiPrintf("SD enabled=%s status=%s", boolToString(CONFIG(isSdCardEnabled)),
|
||||||
sdStatus);
|
sdStatus);
|
||||||
|
@ -130,7 +130,7 @@ static void sdStatistics(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void incLogFileName(void) {
|
static void incLogFileName() {
|
||||||
memset(&FDLogFile, 0, sizeof(FIL)); // clear the memory
|
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
|
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);
|
efiPrintf("Done %d", logFileIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void prepareLogFileName(void) {
|
static void prepareLogFileName() {
|
||||||
strcpy(logName, RUSEFI_LOG_PREFIX);
|
strcpy(logName, RUSEFI_LOG_PREFIX);
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ static void prepareLogFileName(void) {
|
||||||
* This function saves the name of the file in a global variable
|
* This function saves the name of the file in a global variable
|
||||||
* so that we can later append to that file
|
* so that we can later append to that file
|
||||||
*/
|
*/
|
||||||
static void createLogFile(void) {
|
static void createLogFile() {
|
||||||
memset(&FDLogFile, 0, sizeof(FIL)); // clear the memory
|
memset(&FDLogFile, 0, sizeof(FIL)); // clear the memory
|
||||||
prepareLogFileName();
|
prepareLogFileName();
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ static void listDirectory(const char *path) {
|
||||||
/*
|
/*
|
||||||
* MMC card un-mount.
|
* MMC card un-mount.
|
||||||
*/
|
*/
|
||||||
static void mmcUnMount(void) {
|
static void mmcUnMount() {
|
||||||
if (!isSdCardAlive()) {
|
if (!isSdCardAlive()) {
|
||||||
efiPrintf("Error: No File system is mounted. \"mountsd\" first");
|
efiPrintf("Error: No File system is mounted. \"mountsd\" first");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -120,7 +120,7 @@ static brain_pin_e index_to_brainPin(unsigned int i)
|
||||||
return GPIO_INVALID;
|
return GPIO_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reportPins(void) {
|
static void reportPins() {
|
||||||
for (unsigned int i = 0; i < getBrainPinOnchipNum(); i++) {
|
for (unsigned int i = 0; i < getBrainPinOnchipNum(); i++) {
|
||||||
const char *pin_user = getBrainUsedPin(i);
|
const char *pin_user = getBrainUsedPin(i);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ static bool wasLoaded = false;
|
||||||
static const int backupStateOffset = 0, backupDataOffset = 1;
|
static const int backupStateOffset = 0, backupDataOffset = 1;
|
||||||
const size_t backupSize = (BACKUP_RAM_NUM + 1) * sizeof(uint32_t);
|
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");
|
static_assert(backupSize <= BACKUP_FLASH_SIZE, "Backup flash overflow");
|
||||||
|
|
||||||
// first, load the whole buffer into the memory
|
// first, load the whole buffer into the memory
|
||||||
|
|
|
@ -134,12 +134,12 @@ uintptr_t getFlashAddrSecondCopy() {
|
||||||
#define FLASH_OPTKEY1 (0x08192A3B)
|
#define FLASH_OPTKEY1 (0x08192A3B)
|
||||||
#define FLASH_OPTKEY2 (0x4C5D6E7F)
|
#define FLASH_OPTKEY2 (0x4C5D6E7F)
|
||||||
|
|
||||||
static void flash_wait_complete(void)
|
static void flash_wait_complete()
|
||||||
{
|
{
|
||||||
do { __DSB(); } while (FLASH->SR & FLASH_SR_BSY);
|
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_MER1 | FLASH_CR_MER2;
|
||||||
FLASH_CR |= FLASH_CR_STRT;
|
FLASH_CR |= FLASH_CR_STRT;
|
||||||
|
|
|
@ -47,7 +47,7 @@ extern "C" int _gettimeofday(timeval* tv, void* tzvp) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EFI_RTC
|
#if EFI_RTC
|
||||||
static time_t GetTimeUnixSec(void) {
|
static time_t GetTimeUnixSec() {
|
||||||
struct tm tim;
|
struct tm tim;
|
||||||
|
|
||||||
rtcGetTime(&RTCD1, ×pec);
|
rtcGetTime(&RTCD1, ×pec);
|
||||||
|
|
|
@ -501,7 +501,7 @@ static bool cj125periodic(CJ125 *instance DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
|
|
||||||
#if ! EFI_UNIT_TEST
|
#if ! EFI_UNIT_TEST
|
||||||
|
|
||||||
static msg_t cjThread(void)
|
static msg_t cjThread()
|
||||||
{
|
{
|
||||||
chRegSetThreadName("cj125");
|
chRegSetThreadName("cj125");
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ static msg_t cjThread(void)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool cjCheckConfig(void) {
|
static bool cjCheckConfig() {
|
||||||
if (!CONFIG(isCJ125Enabled)) {
|
if (!CONFIG(isCJ125Enabled)) {
|
||||||
efiPrintf("cj125 is disabled. Failed!");
|
efiPrintf("cj125 is disabled. Failed!");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -114,7 +114,7 @@ static SPIConfig hipSpiCfg = {
|
||||||
/*==========================================================================*/
|
/*==========================================================================*/
|
||||||
|
|
||||||
#if EFI_HIP_9011_DEBUG
|
#if EFI_HIP_9011_DEBUG
|
||||||
static void hip_addconsoleActions(void);
|
static void hip_addconsoleActions();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*==========================================================================*/
|
/*==========================================================================*/
|
||||||
|
@ -203,7 +203,7 @@ int Hip9011Hardware::sendSyncCommand(uint8_t tx, uint8_t *rx_ptr) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hip_wake_driver(void)
|
static int hip_wake_driver()
|
||||||
{
|
{
|
||||||
/* Entering a reentrant critical zone.*/
|
/* Entering a reentrant critical zone.*/
|
||||||
syssts_t sts = chSysGetStatusAndLockX();
|
syssts_t sts = chSysGetStatusAndLockX();
|
||||||
|
@ -328,7 +328,7 @@ void hipAdcCallback(adcsample_t adcValue) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hip_testAdvMode(void) {
|
static int hip_testAdvMode() {
|
||||||
int ret;
|
int ret;
|
||||||
uint8_t ret0, ret1, ret2;
|
uint8_t ret0, ret1, ret2;
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ static int hip_testAdvMode(void) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hip_init(void) {
|
static int hip_init() {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = instance.hw->sendSyncCommand(SET_PRESCALER_CMD(instance.prescaler), NULL);
|
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"
|
"Waiting for second ADC sample"
|
||||||
};
|
};
|
||||||
|
|
||||||
static void showHipInfo(void) {
|
static void showHipInfo() {
|
||||||
if (!CONFIG(isHip9011Enabled)) {
|
if (!CONFIG(isHip9011Enabled)) {
|
||||||
efiPrintf("hip9011 driver not active");
|
efiPrintf("hip9011 driver not active");
|
||||||
return;
|
return;
|
||||||
|
@ -670,7 +670,7 @@ static void setHipGain(float value) {
|
||||||
showHipInfo();
|
showHipInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hip_addconsoleActions(void) {
|
static void hip_addconsoleActions() {
|
||||||
addConsoleAction("hipinfo", showHipInfo);
|
addConsoleAction("hipinfo", showHipInfo);
|
||||||
addConsoleActionF("set_gain", setHipGain);
|
addConsoleActionF("set_gain", setHipGain);
|
||||||
addConsoleActionF("set_band", setHipBand);
|
addConsoleActionF("set_band", setHipBand);
|
||||||
|
|
|
@ -73,7 +73,7 @@ static void extCallback(ioportmask_t channel) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void joystickInfo(void) {
|
static void joystickInfo() {
|
||||||
efiPrintf("total %d center=%d@%s", joyTotal, joyCenter,
|
efiPrintf("total %d center=%d@%s", joyTotal, joyCenter,
|
||||||
hwPortname(CONFIG(joystickCenterPin)));
|
hwPortname(CONFIG(joystickCenterPin)));
|
||||||
efiPrintf("a=%d@%s", joyA, hwPortname(CONFIG(joystickAPin)));
|
efiPrintf("a=%d@%s", joyA, hwPortname(CONFIG(joystickAPin)));
|
||||||
|
|
|
@ -29,7 +29,7 @@ static SPIDriver *driver;
|
||||||
|
|
||||||
static SPIConfig spiConfig[EGT_CHANNEL_COUNT];
|
static SPIConfig spiConfig[EGT_CHANNEL_COUNT];
|
||||||
|
|
||||||
static void showEgtInfo(void) {
|
static void showEgtInfo() {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
printSpiState(engineConfiguration);
|
printSpiState(engineConfiguration);
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ uint16_t getEgtValue(int egtChannel) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void egtRead(void) {
|
static void egtRead() {
|
||||||
|
|
||||||
if (driver == NULL) {
|
if (driver == NULL) {
|
||||||
efiPrintf("No SPI selected for EGT");
|
efiPrintf("No SPI selected for EGT");
|
||||||
|
|
|
@ -138,7 +138,7 @@ static char panicMessage[200];
|
||||||
static virtual_timer_t resetTimer;
|
static virtual_timer_t resetTimer;
|
||||||
|
|
||||||
// todo: move this into a hw-specific file
|
// todo: move this into a hw-specific file
|
||||||
void rebootNow(void) {
|
void rebootNow() {
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ void rebootNow(void) {
|
||||||
* Some configuration changes require full firmware reset.
|
* Some configuration changes require full firmware reset.
|
||||||
* Once day we will write graceful shutdown, but that would be one day.
|
* 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...");
|
efiPrintf("Rebooting in 3 seconds...");
|
||||||
chibios_rt::CriticalSectionLocker csl;
|
chibios_rt::CriticalSectionLocker csl;
|
||||||
chVTSetI(&resetTimer, TIME_MS2I(3000), (vtfunc_t) rebootNow, NULL);
|
chVTSetI(&resetTimer, TIME_MS2I(3000), (vtfunc_t) rebootNow, NULL);
|
||||||
|
@ -162,7 +162,7 @@ void onAssertionFailure() {
|
||||||
void runRusEfiWithConfig();
|
void runRusEfiWithConfig();
|
||||||
void runMainLoop();
|
void runMainLoop();
|
||||||
|
|
||||||
void runRusEfi(void) {
|
void runRusEfi() {
|
||||||
efiAssertVoid(CUSTOM_RM_STACK_1, getCurrentRemainingStack() > 512, "init s");
|
efiAssertVoid(CUSTOM_RM_STACK_1, getCurrentRemainingStack() > 512, "init s");
|
||||||
assertEngineReference();
|
assertEngineReference();
|
||||||
engine->setConfig();
|
engine->setConfig();
|
||||||
|
|
|
@ -7,6 +7,5 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void runRusEfi(void);
|
void runRusEfi();
|
||||||
void rebootNow(void);
|
void rebootNow();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
float array16[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
|
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;
|
const int size16 = 16;
|
||||||
|
|
||||||
uint32_t totalOld = 0;
|
uint32_t totalOld = 0;
|
||||||
|
|
|
@ -55,7 +55,7 @@ TEST(misc, testSkipped2_0) {
|
||||||
ASSERT_EQ( 0, GET_RPM()) << "testNoStartUpWarnings RPM";
|
ASSERT_EQ( 0, GET_RPM()) << "testNoStartUpWarnings RPM";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void testDodgeNeonDecoder(void) {
|
static void testDodgeNeonDecoder() {
|
||||||
printf("*************************************************** testDodgeNeonDecoder95\r\n");
|
printf("*************************************************** testDodgeNeonDecoder95\r\n");
|
||||||
|
|
||||||
ASSERT_EQ( 8, getTriggerZeroEventIndex(DODGE_NEON_1995)) << "DODGE_NEON_1995: trigger zero index";
|
ASSERT_EQ( 8, getTriggerZeroEventIndex(DODGE_NEON_1995)) << "DODGE_NEON_1995: trigger zero index";
|
||||||
|
|
Loading…
Reference in New Issue