Fixed bug 3569374.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4692 35acf78f-673a-0410-8e92-d51de3d6d3f4master
parent
7956d88851
commit
1d47a1a5a6
|
@ -290,7 +290,6 @@ CH_IRQ_HANDLER(STM32_USB1_HP_HANDLER) {
|
|||
*/
|
||||
CH_IRQ_HANDLER(STM32_USB1_LP_HANDLER) {
|
||||
uint32_t istr;
|
||||
size_t n;
|
||||
USBDriver *usbp = &USBD1;
|
||||
|
||||
CH_IRQ_PROLOGUE();
|
||||
|
@ -339,17 +338,19 @@ CH_IRQ_HANDLER(STM32_USB1_LP_HANDLER) {
|
|||
|
||||
/* Endpoint events handling.*/
|
||||
while (istr & ISTR_CTR) {
|
||||
size_t n;
|
||||
uint32_t ep;
|
||||
uint32_t epr = STM32_USB->EPR[ep = istr & ISTR_EP_ID_MASK];
|
||||
const USBEndpointConfig *epcp = usbp->epc[ep];
|
||||
|
||||
if (epr & EPR_CTR_TX) {
|
||||
size_t transmitted;
|
||||
/* IN endpoint, transmission.*/
|
||||
EPR_CLEAR_CTR_TX(ep);
|
||||
|
||||
n = (size_t)USB_GET_DESCRIPTOR(ep)->TXCOUNT0;
|
||||
epcp->in_state->txcnt += n;
|
||||
epcp->in_state->txsize -= n;
|
||||
transmitted = (size_t)USB_GET_DESCRIPTOR(ep)->TXCOUNT0;
|
||||
epcp->in_state->txcnt += transmitted;
|
||||
epcp->in_state->txsize -= transmitted;
|
||||
if (epcp->in_state->txsize > 0) {
|
||||
/* Transfer not completed, there are more packets to send.*/
|
||||
if (epcp->in_state->txsize > epcp->in_maxsize)
|
||||
|
@ -362,7 +363,7 @@ CH_IRQ_HANDLER(STM32_USB1_LP_HANDLER) {
|
|||
epcp->in_state->mode.queue.txqueue,
|
||||
n);
|
||||
else {
|
||||
epcp->in_state->mode.linear.txbuf += n;
|
||||
epcp->in_state->mode.linear.txbuf += transmitted;
|
||||
usb_packet_write_from_buffer(USB_GET_DESCRIPTOR(ep),
|
||||
epcp->in_state->mode.linear.txbuf,
|
||||
n);
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
*****************************************************************************
|
||||
|
||||
*** 2.5.1 ***
|
||||
- FIX: Fixed problem in STM32F1xx USB driver after revision 4598 (bug 3569374).
|
||||
- FIX: Fixed GPIO glitch during PAL initialization (bug 3569347)(backported
|
||||
to 2.4.3).
|
||||
- FIX: Fixed Data available event not generated in serial_usb driver (bug
|
||||
|
|
Loading…
Reference in New Issue