We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b8ea68 commit e811615Copy full SHA for e811615
1 file changed
src/helpers/ArduinoHelpers.h
@@ -24,8 +24,13 @@ class ArduinoMillis : public mesh::MillisecondClock {
24
unsigned long getMillis() override { return millis(); }
25
};
26
27
-// Wrap-safe millis deadline check. Handles the 49-day millis() overflow
28
-// using signed comparison (2's complement). Use instead of millis() >= target.
+/**
+ * \brief Wrap-safe millis deadline check, handling the 49-day millis() overflow.
29
+ * \param target The deadline timestamp obtained from millis() + delay.
30
+ * \returns true when the deadline has passed.
31
+ * \note Use this instead of \c millis()>=target which fails near the 32-bit wrap.
32
+ * Works via signed subtraction (2's complement).
33
+ */
34
inline bool millis_passed(unsigned long target) {
35
return (long)(millis() - target) > 0;
36
}
0 commit comments