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
diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h
index b2a9832..d9d970d 100644
--- a/src/pcu_l1_if.h
+++ b/src/pcu_l1_if.h
@@ -33,6 +33,15 @@
}
#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
*/