projects
/
osmocom-bb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba6172a
)
gsm_utils: Just add some constant and timekeeping utils
author
Sylvain Munaut
<tnt@246tNt.com>
Tue, 27 Apr 2010 19:48:40 +0000
(21:48 +0200)
committer
Sylvain Munaut
<tnt@246tNt.com>
Tue, 27 Apr 2010 19:48:40 +0000
(21:48 +0200)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
include/osmocore/gsm_utils.h
patch
|
blob
|
history
diff --git
a/include/osmocore/gsm_utils.h
b/include/osmocore/gsm_utils.h
index
c87e967
..
195e865
100644
(file)
--- a/
include/osmocore/gsm_utils.h
+++ b/
include/osmocore/gsm_utils.h
@@
-27,6
+27,13
@@
#include <stdint.h>
+#define ADD_MODULO(sum, delta, modulo) do { \
+ if ((sum += delta) >= modulo) \
+ sum -= modulo; \
+ } while (0)
+
+#define GSM_MAX_FN (26*51*2048)
+
struct gsm_time {
uint32_t fn; /* FN count */
uint16_t t1; /* FN div (26*51) */