From 2a4f7a155fe68ca59090e2c39abfc7a56405430e Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 5 Jun 2011 23:00:40 -0300 Subject: [PATCH] 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. --- tools/lib/cwtest.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/lib/cwtest.c b/tools/lib/cwtest.c index 411938a..716a220 100644 --- a/tools/lib/cwtest.c +++ b/tools/lib/cwtest.c @@ -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 * moment. */ - switch (atrf_identify(dsc)) { - case artf_at86rf230: + if (atrf_identify(dsc) == artf_at86rf230 || atrf_usb_handle(dsc)) atrf_reset_rf(dsc); - break; - case artf_at86rf231: + else { usleep(2); /* table 7-1: tTR12(typ) = 1 us */ atrf_slp_tr(dsc, 1, 0); usleep(10); /* table 7-1: tTR3(typ) doesn't really apply */ atrf_slp_tr(dsc, 0, 0); usleep(500); /* table 7-1: tTR2(typ) = 380 */ - break; - default: - abort(); } }