Date:2011-06-03 19:25:19 (12 years 9 months ago)
Author:Werner Almesberger
Commit:b73343184731e67b24e2116fce6c38005571843c
Message:atusb/fw/ep0.c: fixed ATUSB_SRAM_READ

- ep0.c (my_setup): ATUSB_SRAM_READ is FROM_DEV, not TO_DEV
- ep0.c (my_setup): in ATUSB_SRAM_READ, write setup->wLength bytes,
not "size" (which is uninitialized)
Files: atusb/fw/ep0.c (2 diffs)

Change Details

atusb/fw/ep0.c
169169        size = setup->wLength+2;
170170        usb_recv(&eps[0], buf+2, setup->wLength, do_buf_write, NULL);
171171        return 1;
172    case ATUSB_TO_DEV(ATUSB_SRAM_READ):
172    case ATUSB_FROM_DEV(ATUSB_SRAM_READ):
173173        debug("ATUSB_SRAM_READ\n");
174174        if (setup->wIndex > SRAM_SIZE)
175175            return 0;
...... 
178178        spi_begin();
179179        spi_send(AT86RF230_SRAM_READ);
180180        spi_send(setup->wIndex);
181        for (i = 0; i != size; i++)
181        for (i = 0; i != setup->wLength; i++)
182182            buf[i] = spi_recv();
183183        spi_end();
184        usb_send(&eps[0], buf, size, NULL, NULL);
184        usb_send(&eps[0], buf, setup->wLength, NULL, NULL);
185185        return 1;
186186
187187    default:

Archive Download the corresponding diff file



interactive