diff options
| author | hathach <[email protected]> | 2018-03-31 13:23:23 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-31 13:23:23 +0700 |
| commit | f1f7153b3b469d2565d5f5b5b8feb932ad219b98 (patch) | |
| tree | 4e72bdd38189e03eee4ed272583b12e76843853b /tinyusb | |
| parent | 68f5c004d836a6d15dfe651de3333c7ab0cc7e5f (diff) | |
clean up nrf52
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/device/usbd.c | 2 | ||||
| -rw-r--r-- | tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c | 24 |
2 files changed, 23 insertions, 3 deletions
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c index e8b73b371..404a66e7e 100644 --- a/tinyusb/device/usbd.c +++ b/tinyusb/device/usbd.c @@ -600,6 +600,8 @@ void dcd_xfer_complete(uint8_t rhport, uint8_t ep_addr, uint32_t xferred_bytes, osal_queue_send(_usbd_q, &task_event);
}
+
+ TU_ASSERT(succeeded, );
}
//--------------------------------------------------------------------+
diff --git a/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c b/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c index 60a21d707..454db01b3 100644 --- a/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c +++ b/tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c @@ -47,6 +47,11 @@ #include "device/dcd.h" +#ifdef SOFTDEVICE_PRESENT +#include "nrf_sdm.h" +#include "nrf_soc.h" +#endif + /*------------------------------------------------------------------*/ /* MACRO TYPEDEF CONSTANT ENUM *------------------------------------------------------------------*/ @@ -89,10 +94,23 @@ typedef struct /*------------------------------------------------------------------*/ /* Controller Start up Sequence *------------------------------------------------------------------*/ + +static bool is_sd_enabled(void) +{ +#ifdef SOFTDEVICE_PRESENT + uint8_t sd_en = 0; + (void) sd_softdevice_is_enabled(&sd_en); + + return sd_en; +#else + return false; +#endif +} + static bool hfclk_running(void) { #ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) + if ( is_sd_enabled() ) { uint32_t is_running; (void) sd_clock_hfclk_is_running(&is_running); @@ -109,7 +127,7 @@ static void hfclk_enable(void) if ( hfclk_running() ) return; #ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) + if ( is_sd_enabled() ) { (void)sd_clock_hfclk_request(); return; @@ -123,7 +141,7 @@ static void hfclk_enable(void) static void hfclk_disable(void) { #ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) + if ( is_sd_enabled() ) { (void)sd_clock_hfclk_release(); return; |
