diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-02-19 14:21:36 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-02-27 19:58:20 +0100 |
commit | d5bbd8ccf79eaf13bc23cc71accbeb3ff638b6dd (patch) | |
tree | 0f1ec34ad152ac9e7933724b35a8d342e8be2abe /src/common/scheduler.c | |
parent | b3a2a3e24f44adcc6660d33cc9684a8f24271e2e (diff) |
trx/scheduler: Use integer math for TOA (Timing of Arrival)
There's no need to express TOA as a float:
* We receive it as signed 16bit integer in units 1/256 symbol periods
* We pass it to L1SAP as signed integer in 1/4 symbol periods
So turn it into an int16_t with 1/256 symbol period accuracy throughout
the code to avoid both float arithmetic as well as loosing any precision.
Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
Diffstat (limited to 'src/common/scheduler.c')
-rw-r--r-- | src/common/scheduler.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c index e6cf541d..edd99d26 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -846,7 +846,7 @@ no_data: /* process uplink burst */ int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t current_fn, - sbit_t *bits, uint16_t nbits, int8_t rssi, float toa) + sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa256) { struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); struct l1sched_chan_state *l1cs; @@ -907,7 +907,7 @@ int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t current_fn, } } - func(l1t, tn, fn, chan, bid, bits, nbits, rssi, toa); + func(l1t, tn, fn, chan, bid, bits, nbits, rssi, toa256); } else if (chan != TRXC_RACH && !l1cs->ho_rach_detect) { sbit_t spare[GSM_BURST_LEN]; memset(spare, 0, GSM_BURST_LEN); |