mirror of https://github.com/rusefi/fome-fw.git
we often mean inline when we say static
This commit is contained in:
parent
8e647e777b
commit
3f8931f341
|
@ -251,7 +251,7 @@ void detectHellenBoardType();
|
|||
#define H_SPI3_SCK Gpio::C10
|
||||
#define H_SPI3_CS Gpio::A15
|
||||
|
||||
static inline void setHellenSdCardSpi1NoCS() {
|
||||
inline void setHellenSdCardSpi1NoCS() {
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_1;
|
||||
engineConfiguration->spi1mosiPin = H_SPI1_MOSI;
|
||||
|
@ -260,17 +260,17 @@ static inline void setHellenSdCardSpi1NoCS() {
|
|||
engineConfiguration->is_enabled_spi_1 = true;
|
||||
}
|
||||
|
||||
static inline void setHellenSdCardSpi1() {
|
||||
inline void setHellenSdCardSpi1() {
|
||||
setHellenSdCardSpi1NoCS();
|
||||
engineConfiguration->sdCardCsPin = H_SPI1_CS1;
|
||||
}
|
||||
|
||||
static inline void setHellen64SdCardSpi1() {
|
||||
inline void setHellen64SdCardSpi1() {
|
||||
setHellenSdCardSpi1NoCS();
|
||||
engineConfiguration->sdCardCsPin = H64_SPI1_CS1;
|
||||
}
|
||||
|
||||
static inline void setHellenSdCardSpi2() {
|
||||
inline void setHellenSdCardSpi2() {
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_2;
|
||||
engineConfiguration->spi2mosiPin = H_SPI2_MOSI;
|
||||
|
@ -280,7 +280,7 @@ static inline void setHellenSdCardSpi2() {
|
|||
engineConfiguration->is_enabled_spi_2 = true;
|
||||
}
|
||||
|
||||
static inline void setHellenSdCardSpi3() {
|
||||
inline void setHellenSdCardSpi3() {
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
|
||||
engineConfiguration->spi3mosiPin = H_SPI3_MOSI;
|
||||
|
@ -293,12 +293,12 @@ static inline 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;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#endif
|
||||
|
||||
// Shifts angle into the [0..720) range for four stroke and [0..360) for two stroke
|
||||
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;
|
||||
|
@ -47,7 +47,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;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -16,12 +16,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));
|
||||
|
@ -103,19 +103,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;
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
#if HAL_USE_CAN
|
||||
CANDriver* detectCanDevice(brain_pin_e pinRx, brain_pin_e pinTx);
|
||||
static bool isValidCanTxPin(brain_pin_e) { return true; }
|
||||
static bool isValidCanRxPin(brain_pin_e) { return true; }
|
||||
inline bool isValidCanTxPin(brain_pin_e) { return true; }
|
||||
inline bool isValidCanRxPin(brain_pin_e) { return true; }
|
||||
#endif // HAL_USE_CAN
|
||||
|
||||
static bool allowFlashWhileRunning() { return true; }
|
||||
inline bool allowFlashWhileRunning() { return true; }
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue