diff options
Diffstat (limited to 'include')
-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) */ |