1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-04 23:39:21 +02:00

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
This commit is contained in:
Werner Almesberger 2011-04-13 13:07:55 -03:00
parent e3463ef8a0
commit 2c1cb715e4

View File

@ -65,7 +65,7 @@ static double rssi_to_dBm(double rssi)
static void sample(const struct sweep *sweep, int cont_tx,
struct sample *res)
struct sample *res, int first)
{
int i, rssi;
int sum = 0, min = -1, max = -1;
@ -79,7 +79,10 @@ static void sample(const struct sweep *sweep, int cont_tx,
* set_channel(sweep->tx, chan);
* usleep(155); / * table 7-2, tTR19 * /
*/
cw_test_begin(sweep->tx, cont_tx);
if (first)
cw_test_begin(sweep->tx, cont_tx);
else
cw_test_resume(sweep->tx);
/* table 7-1, tTR10, doubling since it's a "typical" value */
usleep(2*16);
@ -105,15 +108,26 @@ static void sample(const struct sweep *sweep, int cont_tx,
void do_sweep(const struct sweep *sweep, 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, res++);
sample(sweep, CONT_TX_P500K, res++);
sample(sweep, CONT_TX_M500K, r, chan == 11);
r += 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;
}
}