From 330fe01d803655c395676cf030e8f12087c8835d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 23 Feb 2010 01:34:47 +0100 Subject: Uplink: Use TPU window driven model This means we can even send and receive in the same TDMA frame, provided we keep the usual 3 timeslot distance between DL and UL. --- src/target/firmware/abb/twl3025.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/target/firmware/abb/twl3025.c') diff --git a/src/target/firmware/abb/twl3025.c b/src/target/firmware/abb/twl3025.c index 24149a7..0181713 100644 --- a/src/target/firmware/abb/twl3025.c +++ b/src/target/firmware/abb/twl3025.c @@ -245,6 +245,9 @@ void twl3025_downlink(int on, int16_t at) } } +/* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL - TSP_DELAY */ +#define UPLINK_DELAY (3 * TSP_DELAY + BULCAL_DURATION + BULON_TO_BULCAL + 35) + void twl3025_uplink(int on, int16_t at) { int16_t bul_ena = at - TSP_DELAY - 6; @@ -252,12 +255,19 @@ void twl3025_uplink(int on, int16_t at) if (bul_ena < 0) printf("BULENA time negative (%d)\n", bul_ena); if (on) { - /* FIXME: calibration should be done just before BULENA */ + /* calibration should be done just before BULENA */ + tpu_enq_at(bul_ena - UPLINK_DELAY); + /* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL - TSP_DELAY */ twl3025_tsp_write(BULON); + /* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY - BULON_TO_BULCAL */ tpu_enq_wait(BULON_TO_BULCAL - TSP_DELAY); + /* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION - TSP_DELAY */ twl3025_tsp_write(BULON | BULCAL); + /* bdl_ena - 35 - TSP_DELAY - BULCAL_DURATION */ tpu_enq_wait(BULCAL_DURATION - TSP_DELAY); + /* bdl_ena - 35 - TSP_DELAY */ twl3025_tsp_write(BULON); + /* bdl_ena - 35 */ tpu_enq_wait(35); /* minimum time required to bring the ramp up (really needed?) */ tpu_enq_at(bul_ena); twl3025_tsp_write(BULON | BULENA); -- cgit v1.2.3-55-g7522