14#include <rusefi/arrays.h>
24 return ((x << 8) | (x >> 8));
29 return (((x >> 24) & 0x000000ff) | ((x << 8) & 0x00ff0000) |
30 ((x >> 8) & 0x0000ff00) | ((x << 24) & 0xff000000));
33#define BIT(n) (UINT32_C(1) << (n))
39#define ID2INDEX(id) ((id) - HUMAN_OFFSET)
42#define frequency2periodMs(freq) ((1000.0f) / (freq))
45#define frequency2periodUs(freq) ((1000000.0f) / (freq))
56float efiRound(
float value,
float precision);
59char*
itoa10(
char *p,
int num);
64#define clampPercentValue(x) (clampF(0, x, 100))
67float limitRateOfChange(
float newValue,
float oldValue,
float incrLimitPerSec,
float decrLimitPerSec,
float secsPassed);
74#define IS_NEGATIVE_ZERO(value) (__builtin_signbit(value) && value==0)
75#define fixNegativeZero(value) (IS_NEGATIVE_ZERO(value) ? 0 : value)
77#define assertIsInBounds(length, array, msg) criticalAssertVoid(std::is_unsigned_v<decltype(length)> && (length) < efi::size(array), msg)
79#define assertIsInBoundsWithResult(length, array, msg, failedResult) efiAssert(ObdCode::OBD_PCM_Processor_Fault, std::is_unsigned_v<decltype(length)> && (length) < efi::size(array), msg, failedResult)
83 return val >= min && val <= max;
87 return (
size_t)a - (
size_t)b;
130int getBitRangeLsb(
const uint8_t data[],
int bitIndex,
int bitWidth);
134int getBitRangeMsb(
const uint8_t data[],
int bitIndex,
int bitWidth);
135void setBitRangeMsb(uint8_t data[],
int totalBitIndex,
int bitWidth,
int value);
139void setBitRangeMoto(uint8_t data[],
int totalBitIndex,
int bitWidth,
int value);
int getBitRangeMoto(const uint8_t data[], int bitIndex, int bitWidth)
constexpr size_t operator-(Gpio a, Gpio b)
float limitRateOfChange(float newValue, float oldValue, float incrLimitPerSec, float decrLimitPerSec, float secsPassed)
bool isInRange(T min, T val, T max)
int djb2lowerCase(const char *str)
void setBitRangeMoto(uint8_t data[], int totalBitIndex, int bitWidth, int value)
int motorolaMagicFromDbc(int b, int length)
const char * boolToString(bool value)
bool isPhaseInRange(float test, float current, float next)
float efiRound(float value, float precision)
void setBitRangeMsb(uint8_t data[], int totalBitIndex, int bitWidth, int value)
constexpr Gpio operator+(Gpio a, size_t b)
char * efiTrim(char *param)
int getBitRangeLsb(const uint8_t data[], int bitIndex, int bitWidth)
char * itoa10(char *p, int num)
int getBitRangeMsb(const uint8_t data[], int bitIndex, int bitWidth)
uint32_t SWAP_UINT32(uint32_t x)
uint16_t SWAP_UINT16(uint16_t x)
constexpr remove_reference_t< _Ty > && move(_Ty &&_Arg) noexcept
typename remove_reference< _Ty >::type remove_reference_t
static tstrWifiInitParam param