We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a45b2eb commit ae3c297Copy full SHA for ae3c297
ServoPID/TestServoPID/ArduinoMock.h
@@ -23,13 +23,13 @@ inline void setMockAnalogRead(const int pin, const int value)
23
mock::gAnalogPins.at(pin) = value;
24
}
25
26
-template<typename T>
27
-T constrain(const T v, const T min, const T max)
+template<typename T, typename U>
+T constrain(const T v, const U min, const U max)
28
{
29
- if (v < min)
30
- return min;
31
- if (v > max)
32
- return max;
+ if (v < T(min))
+ return T(min);
+ if (v > T(max))
+ return T(max);
33
return v;
34
35
@@ -100,7 +100,7 @@ class MockSerial
100
101
dataRead.clear();
102
dataWrite.clear();
103
- dataWrite.str(std::string());
+ dataWrite.str({});
104
105
106
std::vector<char> dataRead;
0 commit comments