diff --git a/tools/atrf-path/atrf-path.c b/tools/atrf-path/atrf-path.c index 35ac963..a1e0e96 100644 --- a/tools/atrf-path/atrf-path.c +++ b/tools/atrf-path/atrf-path.c @@ -106,29 +106,26 @@ static void sample(const struct sweep *sweep, int cont_tx, } -void do_sweep(const struct sweep *sweep, struct sample *res) +static void do_half_sweep(const struct sweep *sweep, int cont_tx, + struct sample *res) { - struct sample *r; int chan; - r = res; for (chan = 11; chan <= 26; chan++) { set_channel(sweep->rx, chan); set_channel(sweep->tx, chan); usleep(155); /* table 7-2, tTR19 */ - sample(sweep, CONT_TX_M500K, r, chan == 11); - r += 2; + sample(sweep, cont_tx, res, chan == 11); + res += 2; } - r = res+1; - for (chan = 11; chan <= 26; chan++) { - set_channel(sweep->rx, chan); - set_channel(sweep->tx, chan); - usleep(155); /* table 7-2, tTR19 */ +} - sample(sweep, CONT_TX_P500K, r, chan == 11); - r += 2; - } + +void do_sweep(const struct sweep *sweep, struct sample *res) +{ + do_half_sweep(sweep, CONT_TX_M500K, res); + do_half_sweep(sweep, CONT_TX_P500K, res+1); }