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

NUC505 : added comment on DMA choice

Peter Lawrence 6 лет назад
Родитель
Сommit
df05440d92
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      src/portable/nuvoton/nuc505/dcd_nuc505.c

+ 9 - 3
src/portable/nuvoton/nuc505/dcd_nuc505.c

@@ -33,6 +33,12 @@
   nomenclature of EPA through EPL.
   nomenclature of EPA through EPL.
 */
 */
 
 
+/*
+  Note on OPT_MCU_NUC505_USB_DMA: the author suggests against using this option.
+  The DMA functionality of the USBD peripheral does not appear to succeed with
+  transfer lengths that are longer (> 64 bytes) and are not a multiple of 4.
+*/
+
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
 #if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_NUC505)
 #if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_NUC505)
@@ -211,7 +217,7 @@ static void bus_reset(void)
   current_dma_xfer = NULL;
   current_dma_xfer = NULL;
 }
 }
 
 
-#if 0
+#ifdef OPT_MCU_NUC505_USB_DMA
 /* this must only be called by the ISR; it does its best to share the single DMA engine across all user EPs (IN and OUT) */
 /* this must only be called by the ISR; it does its best to share the single DMA engine across all user EPs (IN and OUT) */
 static void service_dma(void)
 static void service_dma(void)
 {
 {
@@ -467,7 +473,7 @@ void USBD_IRQHandler(void)
 
 
     if (bus_state & USBD_BUSINTSTS_DMADONEIF_Msk)
     if (bus_state & USBD_BUSINTSTS_DMADONEIF_Msk)
     {
     {
-#if 0
+#ifdef OPT_MCU_NUC505_USB_DMA
       if (current_dma_xfer)
       if (current_dma_xfer)
       {
       {
         current_dma_xfer->dma_requested = false;
         current_dma_xfer->dma_requested = false;
@@ -601,7 +607,7 @@ void USBD_IRQHandler(void)
 
 
         if (out_ep)
         if (out_ep)
         {
         {
-#if 0
+#ifdef OPT_MCU_NUC505_USB_DMA
           xfer->dma_requested = true;
           xfer->dma_requested = true;
           service_dma();
           service_dma();
 #else
 #else