1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-29 10:48:28 +02:00

atusb/fw/ep0.c (my_setup): fixed test for ATUSB_SPI_READ2

This commit is contained in:
Werner Almesberger 2011-06-20 13:43:17 -03:00
parent a37bba8755
commit 3f74098ce2

View File

@ -218,7 +218,7 @@ static int my_setup(const struct setup_request *setup)
case ATUSB_FROM_DEV(ATUSB_SPI_READ2): case ATUSB_FROM_DEV(ATUSB_SPI_READ2):
spi_begin(); spi_begin();
spi_send(setup->wValue); spi_send(setup->wValue);
if (req == ATUSB_SPI_READ2) if (req == ATUSB_FROM_DEV(ATUSB_SPI_READ2))
spi_send(setup->wIndex); spi_send(setup->wIndex);
for (i = 0; i != setup->wLength; i++) for (i = 0; i != setup->wLength; i++)
buf[i] = spi_recv(); buf[i] = spi_recv();