Browse Source

Upgrade to Doxygen comment

pull/1972/head
Wessel Nieboer 3 months ago
parent
commit
17f34c56bc
No known key found for this signature in database GPG Key ID: 929C8E45E33B5FD2
  1. 9
      src/helpers/ArduinoHelpers.h

9
src/helpers/ArduinoHelpers.h

@ -24,8 +24,13 @@ public:
unsigned long getMillis() override { return millis(); } unsigned long getMillis() override { return millis(); }
}; };
// Wrap-safe millis deadline check. Handles the 49-day millis() overflow /**
// using signed comparison (2's complement). Use instead of millis() >= target. * \brief Wrap-safe millis deadline check, handling the 49-day millis() overflow.
* \param target The deadline timestamp obtained from millis() + delay.
* \returns true when the deadline has passed.
* \note Use this instead of \c millis()>=target which fails near the 32-bit wrap.
* Works via signed subtraction (2's complement).
*/
inline bool millis_passed(unsigned long target) { inline bool millis_passed(unsigned long target) {
return (long)(millis() - target) > 0; return (long)(millis() - target) > 0;
} }

Loading…
Cancel
Save