From 2514804a796dbdcbf1130dd86d37ee3b2f1f5ea5 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 24 Aug 2010 07:17:42 -0300 Subject: [PATCH] Setting the transmit power was broken. (And LQ works, by the way.) - atrf/tools/atspi-txrx/atspi-txrx.c (set_power): don't wrap around at minimum power to maximum power --- atrf/tools/atspi-txrx/atspi-txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atrf/tools/atspi-txrx/atspi-txrx.c b/atrf/tools/atspi-txrx/atspi-txrx.c index 1a67045..8a575b8 100644 --- a/atrf/tools/atspi-txrx/atspi-txrx.c +++ b/atrf/tools/atspi-txrx/atspi-txrx.c @@ -72,7 +72,7 @@ static void set_power(usb_dev_handle *dev, double power) { int n; - for (n = 0; n != sizeof(tx_pwr)/sizeof(*tx_pwr); n++) + for (n = 0; n != sizeof(tx_pwr)/sizeof(*tx_pwr)-1; n++) if (tx_pwr[n] <= power) break; atspi_reg_write(dev, REG_PHY_TX_PWR, TX_AUTO_CRC_ON | n);