* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* selection among a list of target devices, then similar target
* devices manufactured by PJRC.COM must be included in the list of
* target devices and selectable in the same manner.
* selection among a list of target devices, then similar target
* devices manufactured by PJRC.COM must be included in the list of
* target devices and selectable in the same manner.
//(setup.wIndex == list->wIndex) || ((setup.wValue >> 8) == 3)) {
if (setup.wValue == list->wValue && setup.wIndex == list->wIndex) {
data = list->addr;
//(setup.wIndex == list->wIndex) || ((setup.wValue >> 8) == 3)) {
if (setup.wValue == list->wValue && setup.wIndex == list->wIndex) {
data = list->addr;
ret = rx_first[endpoint];
if (ret) {
rx_first[endpoint] = ret->next;
usb_rx_byte_count_data[endpoint] -= ret->len;
}
ret = rx_first[endpoint];
if (ret) {
rx_first[endpoint] = ret->next;
usb_rx_byte_count_data[endpoint] -= ret->len;
}
//serial_print("rx, epidx=");
//serial_phex(endpoint);
//serial_print(", packet=");
//serial_print("rx, epidx=");
//serial_phex(endpoint);
//serial_print(", packet=");
for (i=1; i <= NUM_ENDPOINTS; i++) {
if (*cfg++ & USB_ENDPT_EPRXEN) {
if (table[index(i, RX, EVEN)].desc == 0) {
table[index(i, RX, EVEN)].addr = packet->buf;
table[index(i, RX, EVEN)].desc = BDT_DESC(64, 0);
usb_rx_memory_needed--;
for (i=1; i <= NUM_ENDPOINTS; i++) {
if (*cfg++ & USB_ENDPT_EPRXEN) {
if (table[index(i, RX, EVEN)].desc == 0) {
table[index(i, RX, EVEN)].addr = packet->buf;
table[index(i, RX, EVEN)].desc = BDT_DESC(64, 0);
usb_rx_memory_needed--;
table[index(i, RX, ODD)].addr = packet->buf;
table[index(i, RX, ODD)].desc = BDT_DESC(64, 1);
usb_rx_memory_needed--;
table[index(i, RX, ODD)].addr = packet->buf;
table[index(i, RX, ODD)].desc = BDT_DESC(64, 1);
usb_rx_memory_needed--;
// we should never reach this point. If we get here, it means
// usb_rx_memory_needed was set greater than zero, but no memory
// we should never reach this point. If we get here, it means
// usb_rx_memory_needed was set greater than zero, but no memory
return;
}
tx_state[endpoint] = next;
b->addr = packet->buf;
b->desc = BDT_DESC(packet->len, ((uint32_t)b & 8) ? DATA1 : DATA0);
return;
}
tx_state[endpoint] = next;
b->addr = packet->buf;
b->desc = BDT_DESC(packet->len, ((uint32_t)b & 8) ? DATA1 : DATA0);
table[index(0, RX, ODD)].addr = ep0_rx1_buf;
table[index(0, TX, EVEN)].desc = 0;
table[index(0, TX, ODD)].desc = 0;
table[index(0, RX, ODD)].addr = ep0_rx1_buf;
table[index(0, TX, EVEN)].desc = 0;
table[index(0, TX, ODD)].desc = 0;