diff --git a/main/shared.h b/main/shared.h index 7fee108..24dbdd2 100644 --- a/main/shared.h +++ b/main/shared.h @@ -25,6 +25,15 @@ static const char* APP_TAG="CINEKID_LEDS"; printf("\n");\ } while(0) +static inline +int min(int a, int b) { return a < b ? a : b; } +static inline +int max(int a, int b) { return a > b ? a : b; } +static inline +int clamp(int x, int mi, int ma) { + return max(mi, min(ma, x)); +} + #define GLOBAL(__a) (uint8_t)(__a|0xE0) #endif // !_shared_h