Просмотр исходного кода

fix issue with cdc write failed sometimes

hathach 7 лет назад
Родитель
Сommit
b07124c623
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/portable/nordic/nrf5x/dcd_nrf5x.c

+ 3 - 2
src/portable/nordic/nrf5x/dcd_nrf5x.c

@@ -70,11 +70,12 @@ typedef struct
 {
   uint8_t* buffer;
   uint16_t total_len;
-  uint16_t actual_len;
+  volatile uint16_t actual_len;
   uint8_t  mps; // max packet size
 
   // nrf52840 will auto ACK OUT packet after DMA is done
-  volatile bool data_received; // indicate packet is already ACK
+  // indicate packet is already ACK
+  volatile bool data_received;
 
 } nom_xfer_t;