microstrain_inertial_driver_common
mip_sdk
src
mip
mip_types.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <stdint.h>
4
#include <stddef.h>
5
#include <stdbool.h>
6
7
#ifdef __cplusplus
8
namespace
mip
{
9
namespace
C {
10
extern
"C"
{
11
#endif
12
13
14
15
// Used like a signed version of size_t
16
typedef
int
mip_remaining_count
;
17
18
28
#ifdef MIP_TIMESTAMP_TYPE
29
typedef
MIP_TIMESTAMP_TYPE
mip_timestamp
;
30
static_assert(
sizeof
(
mip_timestamp
) >= 8 ||
mip_timestamp
(-1) > 0,
"MIP_TIMESTAMP_TYPE must be unsigned unless 64 bits."
);
31
#else
32
typedef
uint64_t
mip_timestamp
;
33
#endif
34
35
typedef
mip_timestamp
mip_timeout
;
36
37
38
#ifdef MIP_ENABLE_DIAGNOSTICS
39
40
// Saturating addition
41
#define MIP_DIAG_INC(counter, amount) do { if (counter + amount < counter) counter = -1; else counter += amount; } while(false)
42
43
#define MIP_DIAG_ZERO(counter) counter = 0
44
45
#else // MIP_ENABLE_DIAGNOSTICS
46
47
// Do nothing if diagnostic counters diabled. Cast amount to void to avoid "unused local variable" warnings.
48
#define MIP_DIAG_INC(counter, amount) (void)amount
49
50
#define MIP_DIAG_ZERO(counter) (void)0
51
52
#endif // MIP_ENABLE_DIAGNOSTICS
53
54
55
#ifdef __cplusplus
56
57
}
// extern "C"
58
}
// namespace C
59
60
using
RemainingCount =
C::mip_remaining_count
;
61
using
Timestamp =
C::mip_timestamp
;
62
using
Timeout =
C::mip_timeout
;
63
64
}
// namespace mip
65
66
#endif
mip
Definition:
ping.cpp:12
mip_timestamp
uint64_t mip_timestamp
Type used for packet timestamps and timeouts.
Definition:
mip_types.h:32
mip_remaining_count
int mip_remaining_count
Definition:
mip_types.h:16
mip_timeout
mip_timestamp mip_timeout
Definition:
mip_types.h:35
microstrain_inertial_driver
Author(s): Brian Bingham, Parker Hannifin Corp
autogenerated on Mon Jun 24 2024 02:51:40