1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 23:55:54 +02:00

tools/lib/cwtest.c (cw_test_end): use reset also on USB devices

ATUSB can't use sleep mode because that would cut the AVR's clock.
The old SiLabs-based boards would not have that issue, but there,
the SLP_TR method is unproven. Besides, reset is as fast on USB.
This commit is contained in:
Werner Almesberger 2011-06-05 23:00:40 -03:00
parent 52657edf38
commit 2a4f7a155f

View File

@ -142,18 +142,13 @@ void cw_test_end(struct atrf_dsc *dsc)
* AT86RF231 also exits test mode if we send it to sleep for a * AT86RF231 also exits test mode if we send it to sleep for a
* moment. * moment.
*/ */
switch (atrf_identify(dsc)) { if (atrf_identify(dsc) == artf_at86rf230 || atrf_usb_handle(dsc))
case artf_at86rf230:
atrf_reset_rf(dsc); atrf_reset_rf(dsc);
break; else {
case artf_at86rf231:
usleep(2); /* table 7-1: tTR12(typ) = 1 us */ usleep(2); /* table 7-1: tTR12(typ) = 1 us */
atrf_slp_tr(dsc, 1, 0); atrf_slp_tr(dsc, 1, 0);
usleep(10); /* table 7-1: tTR3(typ) doesn't really apply */ usleep(10); /* table 7-1: tTR3(typ) doesn't really apply */
atrf_slp_tr(dsc, 0, 0); atrf_slp_tr(dsc, 0, 0);
usleep(500); /* table 7-1: tTR2(typ) = 380 */ usleep(500); /* table 7-1: tTR2(typ) = 380 */
break;
default:
abort();
} }
} }