Skip to content

Commit

Permalink
Fix USB endpoint read with no data (thanks nox771)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Feb 27, 2014
1 parent a781e92 commit 482a1f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions teensy3/usb_dev.c
Expand Up @@ -529,8 +529,10 @@ usb_packet_t *usb_rx(uint32_t endpoint)
if (endpoint >= NUM_ENDPOINTS) return NULL;
__disable_irq();
ret = rx_first[endpoint];
if (ret) rx_first[endpoint] = ret->next;
usb_rx_byte_count_data[endpoint] -= ret->len;
if (ret) {
rx_first[endpoint] = ret->next;
usb_rx_byte_count_data[endpoint] -= ret->len;
}
__enable_irq();
//serial_print("rx, epidx=");
//serial_phex(endpoint);
Expand Down

0 comments on commit 482a1f2

Please sign in to comment.