Speeduino
Loading...
Searching...
No Matches
speeduino
src
stdlib
limits.h
Go to the documentation of this file.
1
6
#pragma once
7
8
#include <stdint.h>
9
10
// std::numeric_limits. See https://en.cppreference.com/w/cpp/types/numeric_limits
11
template
<
typename
T>
12
struct
numeric_limits
{
13
static
constexpr
T
(
max
)(
void
);
14
};
15
16
template
<>
17
struct
numeric_limits
<
uint8_t
> {
18
static
constexpr
uint8_t
(
max
)(
void
) {
return
UINT8_MAX
; }
19
};
20
21
template
<>
22
struct
numeric_limits
<
int8_t
> {
23
static
constexpr
int8_t
(
max
)(
void
) {
return
INT8_MAX
; }
24
};
25
26
template
<>
27
struct
numeric_limits
<
uint16_t
> {
28
static
constexpr
uint16_t
(
max
)(
void
) {
return
UINT16_MAX
; }
29
};
30
31
template
<>
32
struct
numeric_limits
<
int16_t
> {
33
static
constexpr
int16_t
(
max
)(
void
) {
return
INT16_MAX
; }
34
};
35
36
template
<>
37
struct
numeric_limits
<
uint32_t
> {
38
static
constexpr
uint32_t
(
max
)(
void
) {
return
UINT32_MAX
; }
39
};
40
41
template
<>
42
struct
numeric_limits
<
int32_t
> {
43
static
constexpr
int32_t
(
max
)(
void
) {
return
INT32_MAX
; }
44
};
readSerialIntegralTimeout
static TIntegral readSerialIntegralTimeout(void)
Reads an integral type, timing out if necessary.
Definition
comms.cpp:175
numeric_limits
Definition
limits.h:12
numeric_limits::max
static constexpr T() max(void)
Generated by
1.9.8