Skip to content

Commit

Permalink
formatting: (void) and trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Sep 17, 2024
1 parent ee093ab commit 3f8a289
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 30 deletions.
4 changes: 2 additions & 2 deletions firmware/bootloader/bootloader_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern "C" {

class BlinkyThread : public chibios_rt::BaseStaticThread<256> {
protected:
void main(void) override {
void main() override {
Gpio yellow = getWarningLedPin();
Gpio blue = getCommsLedPin();
Gpio green = getRunningLedPin();
Expand Down Expand Up @@ -53,7 +53,7 @@ class BlinkyThread : public chibios_rt::BaseStaticThread<256> {

static BlinkyThread blinky;

int main(void) {
int main() {
halInit();
chSysInit();

Expand Down
6 changes: 3 additions & 3 deletions firmware/config/boards/core48/board_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ setupVbatt() {
engineConfiguration->analogInputDividerCoefficient = 1.56f;

// 6.34k high side/ 1k low side
engineConfiguration->vbattDividerCoeff = (6.34 + 1) / 1;
engineConfiguration->vbattDividerCoeff = (6.34 + 1) / 1;

// Battery sense on PA7
engineConfiguration->vbattAdcChannel = EFI_ADC_9;
Expand All @@ -102,7 +102,7 @@ static void setStepperConfig() {
static void setupSdCard() {

//SD CARD overwrites
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;

engineConfiguration->is_enabled_spi_3 = true;
engineConfiguration->spi3sckPin = Gpio::C10;
Expand Down Expand Up @@ -170,7 +170,7 @@ static void setupDefaultSensorInputs() {
}


void setBoardDefaultConfiguration(void) {
void setBoardDefaultConfiguration() {
setInjectorPins();
setIgnitionPins();
setupDefaultSensorInputs();
Expand Down
4 changes: 2 additions & 2 deletions firmware/config/boards/core8/board_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void setupVbatt() {
engineConfiguration->analogInputDividerCoefficient = 1.56f;

// 6.34k high side/ 1k low side
engineConfiguration->vbattDividerCoeff = (6.34 + 1) / 1;
engineConfiguration->vbattDividerCoeff = (6.34 + 1) / 1;

// Battery sense on PA7
engineConfiguration->vbattAdcChannel = EFI_ADC_0;
Expand Down Expand Up @@ -122,7 +122,7 @@ static void setupDefaultSensorInputs() {

}

void setBoardDefaultConfiguration(void) {
void setBoardDefaultConfiguration() {
setInjectorPins();
setIgnitionPins();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* @brief Board-specific initialization code.
* @todo Add your board-specific code, if any.
*/
void boardInit(void)
{
void boardInit() {
/* NOP */
}

Expand Down
2 changes: 1 addition & 1 deletion firmware/console/binary/serial_can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ can_msg_t CanStreamer::receive(canmbx_t /*mailbox*/, CANRxFrame *crfp, can_sysin
return CAN_MSG_TIMEOUT;
}

void canStreamInit(void) {
void canStreamInit() {
streamer.init();
}

Expand Down
2 changes: 1 addition & 1 deletion firmware/console/binary/serial_can.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class CanStreamer : public ICanStreamer {
virtual can_msg_t receive(canmbx_t mailbox, CANRxFrame *crfp, can_sysinterval_t timeout) override;
};

void canStreamInit(void);
void canStreamInit();

// we don't have canStreamSendTimeout() because we need to "bufferize" the stream and send it in fixed-length packets
msg_t canStreamAddToTxTimeout(size_t *np, const uint8_t *txbuf, sysinterval_t timeout);
Expand Down
4 changes: 2 additions & 2 deletions firmware/console/binary/tunerstudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void TunerStudio::handlePageReadCommand(TsChannelBase* tsChannel, uint16_t offse

#endif // EFI_TUNER_STUDIO

void requestBurn(void) {
void requestBurn() {
#if !EFI_UNIT_TEST
onBurnRequest();

Expand Down Expand Up @@ -709,7 +709,7 @@ static char tsErrorBuff[80];

#endif // EFI_PROD_CODE || EFI_SIMULATOR

void startTunerStudioConnectivity(void) {
void startTunerStudioConnectivity() {
// Assert tune & output channel struct sizes
static_assert(sizeof(persistent_config_s) == TOTAL_CONFIG_SIZE, "TS datapage size mismatch");
// useful trick if you need to know how far off is the static_assert
Expand Down
4 changes: 2 additions & 2 deletions firmware/console/binary/tunerstudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ uint8_t* getWorkingPageAddr();

void updateTunerStudioState();

void requestBurn(void);
void requestBurn();

void startTunerStudioConnectivity(void);
void startTunerStudioConnectivity();

typedef struct {
short int offset;
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/actuators/electronic_throttle_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class EtbController : public IEtbController, public electronic_throttle_s {
// These are set to correct order of magnitude starting points
// so we converge more quickly on the correct values
float m_a = 8;
float m_tu = 0.1f;
float m_tu = 0.1f;

uint8_t m_autotuneCounter = 0;
uint8_t m_autotuneCurrentParam = 0;
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/actuators/idle_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void setManualIdleValvePosition(int positionPercent);

void startIdleThread();
void setDefaultIdleParameters();
void startIdleBench(void);
void startIdleBench();
void setIdleMode(idle_mode_e value);
void setTargetIdleRpm(int value);
void startPedalPins();
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/actuators/idle_thread_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void setTargetIdleRpm(int value) {
/**
* Idle test would activate the solenoid for three seconds
*/
void startIdleBench(void) {
void startIdleBench() {
engine->timeToStopIdleTest = getTimeNowUs() + MS2US(3000); // 3 seconds
efiPrintf("idle valve bench test");
}
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/algo/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Engine::Engine() {
reset();
}

int Engine::getGlobalConfigurationVersion(void) const {
int Engine::getGlobalConfigurationVersion() const {
return globalConfigurationVersion;
}

Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/algo/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class Engine final : public TriggerStateListener {
#endif /* EFI_UNIT_TEST */


int getGlobalConfigurationVersion(void) const;
int getGlobalConfigurationVersion() const;


// a pointer with interface type would make this code nicer but would carry extra runtime
Expand Down
4 changes: 2 additions & 2 deletions firmware/controllers/algo/engine_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ void resetConfigurationExt(engine_type_e engineType);
void rememberCurrentConfiguration();
#endif /* __cplusplus */

void setBoardDefaultConfiguration(void);
void setBoardConfigOverrides(void);
void setBoardDefaultConfiguration();
void setBoardConfigOverrides();
void boardOnConfigurationChange(engine_configuration_s *previousConfiguration);
Gpio getCommsLedPin();
Gpio getWarningLedPin();
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/algo/fuel_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ percent_t getFuelALSCorrection(int rpm) {
config->alsFuelAdjustmentLoadBins, throttleIntent,
config->alsFuelAdjustmentrpmBins, rpm
);
return AlsFuelAdd;
return AlsFuelAdd;
} else
#endif /* EFI_ANTILAG_SYSTEM */
{
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/algo/runtime_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void resetMaxValues() {
#endif // EFI_PROD_CODE
}

void printRuntimeStats(void) {
void printRuntimeStats() {
efiPrintf("maxSchedulingPrecisionLoss=%lu", maxSchedulingPrecisionLoss);

#if EFI_CLOCK_LOCKS
Expand Down
4 changes: 2 additions & 2 deletions firmware/controllers/gauges/malfunction_central.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static int find_position(ObdCode e_code) // Search if code is present
return -1; // -1 if code not found
}

void clearWarnings(void) {
void clearWarnings() {
error_codes_set.count = 0;
}

Expand Down Expand Up @@ -62,6 +62,6 @@ void getErrorCodes(error_codes_set_s * copy) {
copyArray(copy->error_codes, error_codes_set.error_codes);
}

bool hasErrorCodes(void) {
bool hasErrorCodes() {
return error_codes_set.count > 0;
}
4 changes: 2 additions & 2 deletions firmware/controllers/gauges/malfunction_central.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ void removeError(ObdCode errorCode);

void setError(bool isError, ObdCode errorCode);

void clearWarnings(void);
void clearWarnings();
/**
* @brief Copies the current set of errors into the specified buffer
*/
void getErrorCodes(error_codes_set_s * buffer);

bool hasErrorCodes(void);
bool hasErrorCodes();
2 changes: 1 addition & 1 deletion firmware/controllers/gauges/malfunction_indicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool isMilEnabled() {
return isBrainPinValid(engineConfiguration->malfunctionIndicatorPin);
}

void initMalfunctionIndicator(void) {
void initMalfunctionIndicator() {
if (!isMilEnabled()) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion simulator/simulator/framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

// Since all the time logic in the firmware is centered around this function, we only provide this
// function in the firmware. It forces us to exercise the functions that build on this one.
uint32_t getTimeNowLowerNt(void) {
uint32_t getTimeNowLowerNt() {
return US2NT(chVTGetSystemTimeX() * (1000000 / CH_CFG_ST_FREQUENCY));
}

0 comments on commit 3f8a289

Please sign in to comment.