aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_l1_if.h
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-09-19 16:17:06 +0200
committerMax <msuraev@sysmocom.de>2016-10-19 08:23:29 +0000
commitd71e8b32e3e2f9c3856997e945df2eb3afe2937c (patch)
treef377f00b62586a0e3d448f7bb50cc0f9b3fbad82 /src/pcu_l1_if.h
parent4ea452689d545c455cf9c3ade87a3e2c86bf7771 (diff)
Use qbit-TA to update Timing Advance
Separate qbit-TA to TA conversion into separate function and use it for computing and updating Timing Advance. Note: the code was tested with TA=0 only to make sure it does not introduce regressions. Change-Id: I96fdbb20b09fb85fdd9fb6dcf3c25f6bee7f80e4 Fixes: OS#1531
Diffstat (limited to 'src/pcu_l1_if.h')
-rw-r--r--src/pcu_l1_if.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h
index b2a9832e..d9d970da 100644
--- a/src/pcu_l1_if.h
+++ b/src/pcu_l1_if.h
@@ -33,6 +33,15 @@ extern "C" {
}
#endif
+static inline uint8_t qta2ta(int16_t qta)
+{
+ if (qta < 0)
+ return 0;
+ if (qta > 252)
+ qta = 252;
+ return qta >> 2;
+}
+
/*
* L1 Measurement values
*/