http://forum.pjrc.com/threads/24726-Teensy-3-0-Serial-available%28%29-bug?p=42926&viewfull=1#post42926teensy4-core
if (endpoint >= NUM_ENDPOINTS) return NULL; | if (endpoint >= NUM_ENDPOINTS) return NULL; | ||||
__disable_irq(); | __disable_irq(); | ||||
ret = rx_first[endpoint]; | 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(); | __enable_irq(); | ||||
//serial_print("rx, epidx="); | //serial_print("rx, epidx="); | ||||
//serial_phex(endpoint); | //serial_phex(endpoint); |