MIP_SDK  v3.0.0
MicroStrain Communications Library for embedded systems
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 
10 
11 namespace mip {
12 namespace C {
13 extern "C" {
14 
17 
18 #else
19 
21 
24 
25 #endif
26 
27 
28 #ifdef MIP_ENABLE_DIAGNOSTICS
29 
30 // Saturating addition
31 #define MIP_DIAG_INC(counter, amount) do { if (counter + amount < counter) counter = -1; else counter += amount; } while(false)
32 
33 #define MIP_DIAG_ZERO(counter) counter = 0
34 
35 #else // MIP_ENABLE_DIAGNOSTICS
36 
37 // Do nothing if diagnostic counters diabled. Cast amount to void to avoid "unused local variable" warnings.
38 #define MIP_DIAG_INC(counter, amount) (void)amount
39 
40 #define MIP_DIAG_ZERO(counter) (void)0
41 
42 #endif // MIP_ENABLE_DIAGNOSTICS
43 
44 
45 #ifdef __cplusplus
46 
47 } // extern "C"
48 } // namespace C
49 
52 
53 } // namespace mip
54 
55 #endif
mip
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
embedded_time.h
mip::C::mip_timeout
microstrain::C::microstrain_embedded_timestamp mip_timeout
Definition: mip_types.h:16
microstrain::C::microstrain_embedded_timestamp
uint32_t microstrain_embedded_timestamp
Type used for packet timestamps and timeouts.
Definition: embedded_time.h:32
microstrain::EmbeddedTimestamp
C::microstrain_embedded_timestamp EmbeddedTimestamp
Definition: embedded_time.hpp:9
mip::Timestamp
microstrain::EmbeddedTimestamp Timestamp
Definition: mip_types.h:50
mip::Timeout
microstrain::EmbeddedTimeout Timeout
Definition: mip_types.h:51
microstrain::EmbeddedTimeout
C::microstrain_embedded_timeout EmbeddedTimeout
Definition: embedded_time.hpp:10
mip::C::mip_timestamp
microstrain::C::microstrain_embedded_timestamp mip_timestamp
Definition: mip_types.h:15
embedded_time.hpp