Date:2011-04-13 18:07:55 (8 years 9 months ago)
Author:Werner Almesberger
Commit:2c1cb715e4d1cdeb0fce0d85377315525836e7bb
Message:atrf-path: sweep offsets separately, so that the we can reuse the cw setup

atrf-path -g ... 10 10 time:

before 1.92 s
after 0.65 s (34%)

- atrf-path.c (do_sweep): separate -0.5 MHz and +0.5 MHz sweep
- atrf-path.c (sample, do_sweep): set up cw test mode only twice per
sweep (once for each offset), and simply resume in all other cases
Files: tools/atrf-path/atrf-path.c (3 diffs)

Change Details

tools/atrf-path/atrf-path.c
6565
6666
6767static void sample(const struct sweep *sweep, int cont_tx,
68    struct sample *res)
68    struct sample *res, int first)
6969{
7070    int i, rssi;
7171    int sum = 0, min = -1, max = -1;
...... 
7979 * set_channel(sweep->tx, chan);
8080 * usleep(155); / * table 7-2, tTR19 * /
8181 */
82    cw_test_begin(sweep->tx, cont_tx);
82    if (first)
83        cw_test_begin(sweep->tx, cont_tx);
84    else
85        cw_test_resume(sweep->tx);
8386    /* table 7-1, tTR10, doubling since it's a "typical" value */
8487    usleep(2*16);
8588
...... 
105108
106109void do_sweep(const struct sweep *sweep, struct sample *res)
107110{
111    struct sample *r;
108112    int chan;
109113
114    r = res;
115    for (chan = 11; chan <= 26; chan++) {
116        set_channel(sweep->rx, chan);
117        set_channel(sweep->tx, chan);
118        usleep(155); /* table 7-2, tTR19 */
119
120        sample(sweep, CONT_TX_M500K, r, chan == 11);
121        r += 2;
122    }
123    r = res+1;
110124    for (chan = 11; chan <= 26; chan++) {
111125        set_channel(sweep->rx, chan);
112126        set_channel(sweep->tx, chan);
113127        usleep(155); /* table 7-2, tTR19 */
114128
115        sample(sweep, CONT_TX_M500K, res++);
116        sample(sweep, CONT_TX_P500K, res++);
129        sample(sweep, CONT_TX_P500K, r, chan == 11);
130        r += 2;
117131    }
118132}
119133

Archive Download the corresponding diff file



interactive