![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
my new gear...
Diff: portSet.hpp
- Revision:
- 13:31a44ed824b0
- Parent:
- 12:562f433b5e98
diff -r 562f433b5e98 -r 31a44ed824b0 portSet.hpp --- a/portSet.hpp Tue Jul 05 08:56:23 2022 +0000 +++ b/portSet.hpp Tue Jul 05 09:00:35 2022 +0000 @@ -1,6 +1,14 @@ #pragma once #include <mbed.h> +inline int constrain(int x,int a,int b){ + return (x < a ? a : x > b ? b : x); +} + +inline double constrain(double x,double a,double b){ + return (x < a ? a : x > b ? b : x); +} + typedef struct Port{ PinName pin[2]; }Port; \ No newline at end of file