@@ -120,10 +120,35 @@ extern "C"{
120
120
#define ARDUINO_LMIC_VERSION_GET_LOCAL (v ) \
121
121
((v) & 0xFFu)
122
122
123
+ /// \brief convert a semantic version to an ordinal integer.
124
+ #define ARDUINO_LMIC_VERSION_TO_ORDINAL (v ) \
125
+ (((v) & 0xFFFFFF00u) | (((v) - 1) & 0xFFu))
126
+
127
+ /// \brief compare two semantic versions
128
+ /// \return \c true if \p a is less than \p b (as a semantic version).
129
+ #define ARDUINO_LMIC_VERSION_COMPARE_LT (a , b ) \
130
+ (ARDUINO_LMIC_VERSION_TO_ORDINAL(a) < ARDUINO_LMIC_VERSION_TO_ORDINAL(b))
131
+
132
+ /// \brief compare two semantic versions
133
+ /// \return \c true if \p a is less than or equal to \p b (as a semantic version).
134
+ #define ARDUINO_LMIC_VERSION_COMPARE_LE (a , b ) \
135
+ (ARDUINO_LMIC_VERSION_TO_ORDINAL(a) <= ARDUINO_LMIC_VERSION_TO_ORDINAL(b))
136
+
137
+ /// \brief compare two semantic versions
138
+ /// \return \c true if \p a is greater than \p b (as a semantic version).
139
+ #define ARDUINO_LMIC_VERSION_COMPARE_GT (a , b ) \
140
+ (ARDUINO_LMIC_VERSION_TO_ORDINAL(a) > ARDUINO_LMIC_VERSION_TO_ORDINAL(b))
141
+
142
+ /// \brief compare two semantic versions
143
+ /// \return \c true if \p a is greater than or equal to \p b (as a semantic version).
144
+ #define ARDUINO_LMIC_VERSION_COMPARE_GE (a , b ) \
145
+ (ARDUINO_LMIC_VERSION_TO_ORDINAL(a) >= ARDUINO_LMIC_VERSION_TO_ORDINAL(b))
146
+
147
+
123
148
//! Only For Antenna Tuning Tests !
124
149
//#define CFG_TxContinuousMode 1
125
150
126
- // since this was annouunced as the API variable, we keep it. But it's not used,
151
+ // since this was announced as the API variable, we keep it. But it's not used,
127
152
// MAX_LEN_FRAME is what the code uses.
128
153
enum { MAX_FRAME_LEN = MAX_LEN_FRAME }; //!< Library cap on max frame length
129
154
@@ -132,10 +157,10 @@ enum { MAX_MISSED_BCNS = (2 * 60 * 60 + 127) / 128 }; //!< threshold for d
132
157
// note that we need 100 ppm timing accuracy for
133
158
// this, to keep the timing error to +/- 700ms.
134
159
enum { MAX_RXSYMS = 350 }; // Stop tracking beacon if sync error grows beyond this. A 0.4% clock error
135
- // at SF9.125k means 512 ms; one sybol is 4.096 ms,
160
+ // at SF9.125k means 512 ms; one symbol is 4.096 ms,
136
161
// so this needs to be at least 125 for an STM32L0.
137
162
// And for 100ppm clocks and 2 hours of beacon misses,
138
- // this needs to accomodate 1.4 seconds of error at
163
+ // this needs to accommodate 1.4 seconds of error at
139
164
// 4.096 ms/sym or at least 342 symbols.
140
165
141
166
enum { LINK_CHECK_CONT = 0 , // continue with this after reported dead link
0 commit comments