diff --git a/include/utils.h b/include/utils.h index bf67d866..538ec537 100644 --- a/include/utils.h +++ b/include/utils.h @@ -8,7 +8,11 @@ namespace utils { - int32_t change(int32_t x, int32_t in_min, int32_t in_max, int32_t out_min, int32_t out_max); + inline int32_t change(int32_t x, int32_t in_min, int32_t in_max, int32_t out_min, int32_t out_max) + { + return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; + } + float GetUserThrottleCommand(CanHardware*); float ProcessThrottle(int); float ProcessUdc(int); diff --git a/src/utils.cpp b/src/utils.cpp index 39b58d2a..9338571f 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -20,12 +20,6 @@ int32_t NetWh=0; bool Timer1Run = false; - -int32_t change(int32_t x, int32_t in_min, int32_t in_max, int32_t out_min, int32_t out_max) -{ - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - void PostErrorIfRunning(ERROR_MESSAGE_NUM err) { if (Param::GetInt(Param::opmode) == MOD_RUN)