Selaa lähdekoodia

Merge pull request #829 from kasjer/kasjer/fix-build-for-nrf5340

Allow build for NRF5340 MCU
Ha Thach 4 vuotta sitten
vanhempi
sitoutus
c5e95a8f8d
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      src/portable/nordic/nrf5x/dcd_nrf5x.c

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

@@ -833,9 +833,8 @@ void tusb_hal_nrf_power_event (uint32_t event)
         NRF_USBD->EVENTCAUSE = USBD_EVENTCAUSE_READY_Msk;
         NRF_USBD->EVENTCAUSE = USBD_EVENTCAUSE_READY_Msk;
         __ISB(); __DSB(); // for sync
         __ISB(); __DSB(); // for sync
 
 
-        /* Enable the peripheral */
+#ifdef NRF52_SERIES
         // ERRATA 171, 187, 166
         // ERRATA 171, 187, 166
-
         if ( nrfx_usbd_errata_187() )
         if ( nrfx_usbd_errata_187() )
         {
         {
           // CRITICAL_REGION_ENTER();
           // CRITICAL_REGION_ENTER();
@@ -867,7 +866,9 @@ void tusb_hal_nrf_power_event (uint32_t event)
           }
           }
           // CRITICAL_REGION_EXIT();
           // CRITICAL_REGION_EXIT();
         }
         }
+#endif
 
 
+        /* Enable the peripheral */
         NRF_USBD->ENABLE = 1;
         NRF_USBD->ENABLE = 1;
         __ISB(); __DSB(); // for sync
         __ISB(); __DSB(); // for sync
 
 
@@ -889,6 +890,7 @@ void tusb_hal_nrf_power_event (uint32_t event)
       NRF_USBD->EVENTCAUSE = USBD_EVENTCAUSE_READY_Msk;
       NRF_USBD->EVENTCAUSE = USBD_EVENTCAUSE_READY_Msk;
       __ISB(); __DSB(); // for sync
       __ISB(); __DSB(); // for sync
 
 
+#ifdef NRF52_SERIES
       if ( nrfx_usbd_errata_171() )
       if ( nrfx_usbd_errata_171() )
       {
       {
         // CRITICAL_REGION_ENTER();
         // CRITICAL_REGION_ENTER();
@@ -929,6 +931,7 @@ void tusb_hal_nrf_power_event (uint32_t event)
 
 
         __ISB(); __DSB();
         __ISB(); __DSB();
       }
       }
+#endif
 
 
       // ISO buffer Lower half for IN, upper half for OUT
       // ISO buffer Lower half for IN, upper half for OUT
       NRF_USBD->ISOSPLIT = USBD_ISOSPLIT_SPLIT_HalfIN;
       NRF_USBD->ISOSPLIT = USBD_ISOSPLIT_SPLIT_HalfIN;