reducing code duplication

This commit is contained in:
rusefi 2020-04-20 15:57:03 -04:00
parent 7537074482
commit 656331ebe9
2 changed files with 5 additions and 7 deletions

View File

@ -200,13 +200,6 @@ void setIdleValvePosition(int positionPercent) {
#endif /* EFI_UNIT_TEST */
/**
* clamps value into the [0, 100] range
*/
percent_t clampPercentValue(percent_t value) {
return maxF(minF(value, 100), 0);
}
static percent_t manualIdleController(float cltCorrection DECLARE_ENGINE_PARAMETER_SUFFIX) {
percent_t correctedPosition = cltCorrection * CONFIG(manIdlePosition);

View File

@ -63,6 +63,11 @@ char* itoa10(char *p, int num);
bool isSameF(float v1, float v2);
float clampF(float min, float clamp, float max);
/**
* clamps value into the [0, 100] range
*/
#define clampPercentValue(x) (clampF(0, x, 100))
bool strEqualCaseInsensitive(const char *str1, const char *str2);
bool strEqual(const char *str1, const char *str2);