Add millis helper macros
This commit is contained in:
1 parent
723d4d6f61
commit
0e06aaa2bc
10 files changed
+26
-23
No files matched your search
@@ -25,5 +25,9 @@
|
||||
|
||||
typedef uint32_t millis_t;
|
||||
|
||||
#define SEC_TO_MS(N) millis_t((N)*1000UL)
|
||||
#define MIN_TO_MS(N) SEC_TO_MS((N)*60UL)
|
||||
#define MS_TO_SEC(N) millis_t((N)/1000UL)
|
||||
|
||||
#define PENDING(NOW,SOON) ((int32_t)(NOW-(SOON))<0)
|
||||
#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
|
||||
Reference in new issue
Block a user