IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2011-04-13 18:07:55 (12 years 11 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 | ||
---|---|---|
65 | 65 | |
66 | 66 | |
67 | 67 | static void sample(const struct sweep *sweep, int cont_tx, |
68 | struct sample *res) | |
68 | struct sample *res, int first) | |
69 | 69 | { |
70 | 70 | int i, rssi; |
71 | 71 | int sum = 0, min = -1, max = -1; |
... | ... | |
79 | 79 | * set_channel(sweep->tx, chan); |
80 | 80 | * usleep(155); / * table 7-2, tTR19 * / |
81 | 81 | */ |
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); | |
83 | 86 | /* table 7-1, tTR10, doubling since it's a "typical" value */ |
84 | 87 | usleep(2*16); |
85 | 88 | |
... | ... | |
105 | 108 | |
106 | 109 | void do_sweep(const struct sweep *sweep, struct sample *res) |
107 | 110 | { |
111 | struct sample *r; | |
108 | 112 | int chan; |
109 | 113 | |
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; | |
110 | 124 | for (chan = 11; chan <= 26; chan++) { |
111 | 125 | set_channel(sweep->rx, chan); |
112 | 126 | set_channel(sweep->tx, chan); |
113 | 127 | usleep(155); /* table 7-2, tTR19 */ |
114 | 128 | |
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; | |
117 | 131 | } |
118 | 132 | } |
119 | 133 |