Files
firmware/src/meshUtils.h

15 lines
435 B
C
Raw Normal View History

#pragma once
2024-08-09 01:43:13 -05:00
#include "DebugConfiguration.h"
#include <stdint.h>
/// C++ v17+ clamp function, limits a given value to a range defined by lo and hi
2023-01-21 14:34:29 +01:00
template <class T> constexpr const T &clamp(const T &v, const T &lo, const T &hi)
{
return (v < lo) ? lo : (hi < v) ? hi : v;
2023-08-28 11:13:17 -05:00
}
#if (defined(ARCH_PORTDUINO) && !defined(STRNSTR))
#define STRNSTR
#include <string.h>
2023-08-28 11:13:17 -05:00
char *strnstr(const char *s, const char *find, size_t slen);
#endif