diff options
author | Max <msuraev@sysmocom.de> | 2017-05-16 16:10:45 +0200 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-05-26 07:55:52 +0000 |
commit | 9dabfa2c2b882bf4ce72c941f021f7a439de041a (patch) | |
tree | 6f060cdd5d071f9b156b5cbaafd1e167a4b3b71f /src/pcu_utils.h | |
parent | 356ac618f1f4b455e411507c4be4c9909fe927bb (diff) |
Cleanup FN scheduling
* replace magic number with defined constant
* move copy-pasted code to inline functions
* remove unused code
Change-Id: I6fee0714453d0c3c3f3f875f88daea2d9c477331
Related: OS#1524
Diffstat (limited to 'src/pcu_utils.h')
-rw-r--r-- | src/pcu_utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pcu_utils.h b/src/pcu_utils.h index d6644462..3a64a471 100644 --- a/src/pcu_utils.h +++ b/src/pcu_utils.h @@ -20,6 +20,11 @@ inline int msecs_to_frames(int msecs) { return (msecs * (1024 * 1000 / 4615)) / 1024; } +inline uint32_t next_fn(uint32_t fn, uint32_t offset) +{ + return (fn + offset) % GSM_MAX_FN; +} + inline void csecs_to_timeval(unsigned csecs, struct timeval *tv) { tv->tv_sec = csecs / 100; tv->tv_usec = (csecs % 100) * 10000; |