we often mean inline when we say static

This commit is contained in:
Matthew Kennedy 2024-03-28 21:20:40 -04:00 committed by rusefillc
parent 19f628658a
commit 4696848ad4
6 changed files with 16 additions and 16 deletions

View File

@ -286,7 +286,7 @@ static void setHellen64SdCardSpi() {
engineConfiguration->sdCardCsPin = Gpio::MM64_SPI3_CS;
}
static inline void setHellenSdCardSpi2() {
inline void setHellenSdCardSpi2() {
engineConfiguration->isSdCardEnabled = true;
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_2;
engineConfiguration->spi2mosiPin = H_SPI2_MOSI;
@ -296,7 +296,7 @@ static inline void setHellenSdCardSpi2() {
engineConfiguration->is_enabled_spi_2 = true;
}
static void setHellenSdCardSpi3() {
inline void setHellenSdCardSpi3() {
setHellenSdCardSpi3NoCS();
engineConfiguration->sdCardCsPin = H_SPI3_CS;
}
@ -304,12 +304,12 @@ static void setHellenSdCardSpi3() {
// *pullups* files CLT R211 IAT R213
#define HELLEN_DEFAULT_AT_PULLUP 4700
static inline void setDefaultHellenAtPullUps() {
inline void setDefaultHellenAtPullUps(){
engineConfiguration->clt.config.bias_resistor = HELLEN_DEFAULT_AT_PULLUP;
engineConfiguration->iat.config.bias_resistor = HELLEN_DEFAULT_AT_PULLUP;
}
static inline void setHellenMMbaro() {
inline void setHellenMMbaro() {
engineConfiguration->lps25BaroSensorScl = Gpio::B10;
engineConfiguration->lps25BaroSensorSda = Gpio::B11;
}

View File

@ -29,7 +29,7 @@
// Shifts angle into the [0..720) range for four stroke and [0..360) for two stroke
// See also wrapVvt
static inline void wrapAngle(angle_t& angle, const char* msg, ObdCode code) {
inline void wrapAngle(angle_t& angle, const char* msg, ObdCode code) {
if (cisnan(angle)) {
firmwareError(ObdCode::CUSTOM_ERR_ANGLE, "a NaN %s", msg);
angle = 0;
@ -48,7 +48,7 @@ static inline void wrapAngle(angle_t& angle, const char* msg, ObdCode code) {
}
// proper method avoids un-wrapped state of variables
static inline angle_t wrapAngleMethod(angle_t param, const char *msg = "", ObdCode code = ObdCode::OBD_PCM_Processor_Fault) {
inline angle_t wrapAngleMethod(angle_t param, const char *msg = "", ObdCode code = ObdCode::OBD_PCM_Processor_Fault) {
wrapAngle(param, msg, code);
return param;
}

View File

@ -17,7 +17,7 @@
float getAnalogInputDividerCoefficient(adc_channel_e);
static inline bool isAdcChannelValid(adc_channel_e hwChannel) {
inline bool isAdcChannelValid(adc_channel_e hwChannel) {
if (hwChannel <= EFI_ADC_NONE) {
return false;
} else if (hwChannel >= EFI_ADC_LAST_CHANNEL) {

View File

@ -19,12 +19,12 @@ int djb2lowerCase(const char *str);
// http://en.wikipedia.org/wiki/Endianness
static inline uint16_t SWAP_UINT16(uint16_t x)
inline uint16_t SWAP_UINT16(uint16_t x)
{
return ((x << 8) | (x >> 8));
}
static inline uint32_t SWAP_UINT32(uint32_t x)
inline uint32_t SWAP_UINT32(uint32_t x)
{
return (((x >> 24) & 0x000000ff) | ((x << 8) & 0x00ff0000) |
((x >> 8) & 0x0000ff00) | ((x << 24) & 0xff000000));
@ -85,19 +85,19 @@ bool isInRange(T min, T val, T max) {
return val >= min && val <= max;
}
static constexpr size_t operator-(Gpio a, Gpio b) {
inline constexpr size_t operator-(Gpio a, Gpio b) {
return (size_t)a - (size_t)b;
}
static constexpr Gpio operator-(Gpio a, size_t b) {
inline constexpr Gpio operator-(Gpio a, size_t b) {
return (Gpio)((size_t)a - b);
}
static constexpr Gpio operator+(Gpio a, size_t b) {
inline constexpr Gpio operator+(Gpio a, size_t b) {
return (Gpio)((size_t)a + b);
}
static constexpr Gpio operator+(size_t a, Gpio b) {
inline constexpr Gpio operator+(size_t a, Gpio b) {
// addition is commutative, just use the other operator
return b + a;
}

View File

@ -2,8 +2,8 @@
#if HAL_USE_CAN
CANDriver* detectCanDevice(brain_pin_e pinRx, brain_pin_e pinTx);
bool isValidCanTxPin(brain_pin_e);
bool isValidCanRxPin(brain_pin_e);
inline bool isValidCanTxPin(brain_pin_e) { return true; }
inline bool isValidCanRxPin(brain_pin_e) { return true; }
void canHwInfo(CANDriver*);
#endif // HAL_USE_CAN

View File

@ -9,7 +9,7 @@
#include "rusefi_hw_enums.h"
static inline bool isAdcChannelValid(adc_channel_e hwChannel) {
inline bool isAdcChannelValid(adc_channel_e hwChannel) {
if (hwChannel <= EFI_ADC_NONE) {
return false;
} else if (hwChannel >= EFI_ADC_LAST_CHANNEL) {