1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

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

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;