diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2010-09-20 20:55:09 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2010-09-26 20:05:23 +0200 |
commit | 48d3a7ab4c36627b55a948ec79977d268d0aaa4a (patch) | |
tree | 4af59d9a51441fff4affed6bdb4969f34ede2577 | |
parent | 2400d60d0de345ea832f7153a227ac52722e33f3 (diff) |
fw/layer1: New TPU window sync method
This is Dieter's sync method adapted to the new TPU stuff.
Not perfect, but should work for TS[0:7] as long as you
leave a free frame between each TS changes ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r-- | src/target/firmware/layer1/tpu_window.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/target/firmware/layer1/tpu_window.c b/src/target/firmware/layer1/tpu_window.c index 3cf473d2..5cb1a5d4 100644 --- a/src/target/firmware/layer1/tpu_window.c +++ b/src/target/firmware/layer1/tpu_window.c @@ -73,14 +73,21 @@ static int _win_setup(__unused uint8_t p1, __unused uint8_t p2, __unused uint8_t rfch_get_params(&l1s.next_time, NULL, NULL, &tn); - tpu_enq_offset( (5000 + l1s.tpu_offset + (L1_BURST_LENGTH_Q * tn)) % 5000 ); - tpu_enq_at(5000 - 1000 - (L1_BURST_LENGTH_Q * tn)); + tpu_enq_at(4740); + tpu_enq_sync((5000 + l1s.tpu_offset + (L1_BURST_LENGTH_Q * tn)) % 5000); return 0; } static int _win_cleanup(__unused uint8_t p1, __unused uint8_t p2, __unused uint8_t p3) { + uint8_t tn; + + rfch_get_params(&l1s.next_time, NULL, NULL, &tn); + + /* restore offset */ + tpu_enq_offset((5000 + l1s.tpu_offset + (L1_BURST_LENGTH_Q * tn)) % 5000); + return 0; } |