Merge pull request #733 from blckmn/vcp_disable

Disable IRQs whilst transferring bytes on VCP (F4)
This commit is contained in:
J Blackman 2016-07-14 07:23:09 +10:00 committed by GitHub
commit 38c737d998
1 changed files with 3 additions and 0 deletions

View File

@ -223,6 +223,8 @@ static uint32_t rxPackets = 0;
static uint16_t VCP_DataRx(uint8_t* Buf, uint32_t Len)
{
__disable_irq();
rxPackets++;
for (uint32_t i = 0; i < Len; i++) {
@ -232,6 +234,7 @@ static uint16_t VCP_DataRx(uint8_t* Buf, uint32_t Len)
rxTotalBytes++;
}
__enable_irq();
if(receiveLength > (USB_RX_BUFSIZE-1))
return USBD_FAIL;