1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-12 16:22:22 +01:00

Introduce clamp as a template function (#1953)

This commit is contained in:
Stefan Agner
2021-07-14 07:08:18 +02:00
committed by GitHub
parent 08b67e7aea
commit 5cb0c11feb
13 changed files with 17 additions and 14 deletions

View File

@@ -80,7 +80,7 @@ class HighFrequencyLoopRequester {
* @param max The maximum value.
* @return val clamped in between min and max.
*/
float clamp(float val, float min, float max);
template<typename T> T clamp(T val, T min, T max);
/** Linearly interpolate between end start and end by completion.
*