mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-08 13:41:28 +00:00
![Jonathan Bennett](/assets/img/avatar_default.png)
* Move to Portduino's getMacAddr() * Add ST7735/S screen support * Push Raspbian support into native target * Remove latent pigpio references. * CardKB defensive programming * Adds configurable spidev * Fixes to build on Fedora 40 * ENUMs are not #defines. Pull latest portduino * Add more configuration options for SPI displays * Add config.yaml option to set DIO3_TCXO_VOLTAGE * change tft clear() to fillScreen() Maintains compatability with ESPI driver. * Adds TXen and RXen pins to portduino * Add -c --config options to specify config file * Fail when a specified config file is unavailable --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
13 lines
383 B
C++
13 lines
383 B
C++
#pragma once
|
|
|
|
/// C++ v17+ clamp function, limits a given value to a range defined by lo and hi
|
|
template <class T> constexpr const T &clamp(const T &v, const T &lo, const T &hi)
|
|
{
|
|
return (v < lo) ? lo : (hi < v) ? hi : v;
|
|
}
|
|
|
|
#if (defined(ARCH_PORTDUINO) && !defined(STRNSTR))
|
|
#define STRNSTR
|
|
#include <string.h>
|
|
char *strnstr(const char *s, const char *find, size_t slen);
|
|
#endif |