Date:2011-04-13 19:17:01 (12 years 11 months ago)
Author:Werner Almesberger
Commit:a7d9dfd258fc9da71d23e96df0ab9470b19acce9
Message:atrf-path.c: do cw test setup only once if sweeping a single offset

atrf-path -T +0.5 -g ... 10 10 time:

before: 0.32-0.33 s
after: 0.27-0.29 s (88%)

- atrf-path.c (sample): force cw test setup if never done before
- atrf-path.c (do_half_sweep): only request cw test setup if sweeping
both offsets
Files: tools/atrf-path/atrf-path.c (3 diffs)

Change Details

tools/atrf-path/atrf-path.c
6868static void sample(const struct sweep *sweep, int cont_tx,
6969    struct sample *res, int first)
7070{
71    static int need_init = 1;
7172    int i, rssi;
7273    int sum = 0, min = -1, max = -1;
7374    double offset = tx_power_step2dBm(sweep->tx, sweep->power);
...... 
8081 * set_channel(sweep->tx, chan);
8182 * usleep(155); / * table 7-2, tTR19 * /
8283 */
83    if (first)
84    if (first || need_init) {
8485        cw_test_begin(sweep->tx, cont_tx);
85    else
86        need_init = 0;
87    } else {
8688        cw_test_resume(sweep->tx);
89    }
8790    /* table 7-1, tTR10, doubling since it's a "typical" value */
8891    usleep(2*16);
8992
...... 
119122        set_channel(sweep->tx, chan);
120123        usleep(155); /* table 7-2, tTR19 */
121124
122        sample(sweep, cont_tx, res, chan == 11);
125        sample(sweep, cont_tx, res, chan == 11 && !sweep->cont_tx);
123126        res += 2;
124127    }
125128}

Archive Download the corresponding diff file



interactive