diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2010-04-27 21:48:40 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2010-04-27 21:48:40 +0200 |
commit | 221030fc85c9e0232eb0adcf1142ac1c48c8778a (patch) | |
tree | 850c9a5fd5659f5b8f18dfd94a5b467a0715c959 /include/osmocore/gsm_utils.h | |
parent | ba6172a7fd3e4fcb609ca1e0ac693022e4810dad (diff) |
gsm_utils: Just add some constant and timekeeping utils
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'include/osmocore/gsm_utils.h')
-rw-r--r-- | include/osmocore/gsm_utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/osmocore/gsm_utils.h b/include/osmocore/gsm_utils.h index c87e967b..195e865c 100644 --- 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) */ |