diff options
| author | hathach <[email protected]> | 2018-07-17 23:55:56 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-07-17 23:55:56 +0700 |
| commit | 421ae8fc82b884e087e99c8ab3fa25883a3dd623 (patch) | |
| tree | 1a131afaa1cb19665b6eda9e674652a2a3848c4f /src/portable | |
| parent | 6129670e4a23812d1926b15c191d76538f7a325a (diff) | |
nrf: move power setup out of stack (to application)
Diffstat (limited to 'src/portable')
| -rw-r--r-- | src/portable/nordic/nrf5x/hal_nrf5x.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/portable/nordic/nrf5x/hal_nrf5x.c b/src/portable/nordic/nrf5x/hal_nrf5x.c index c1d8f0318..806d8f098 100644 --- a/src/portable/nordic/nrf5x/hal_nrf5x.c +++ b/src/portable/nordic/nrf5x/hal_nrf5x.c @@ -177,36 +177,6 @@ static void hfclk_disable(void) *------------------------------------------------------------------*/ bool tusb_hal_init(void) { - // TODO may move to application - - // USB power may already be ready at this time -> no event generated - // We need to execute the handler based on the status - uint32_t usb_reg; - -#ifdef SOFTDEVICE_PRESENT - if ( is_sd_enabled() ) - { - sd_power_usbdetected_enable(true); - sd_power_usbpwrrdy_enable(true); - sd_power_usbremoved_enable(true); - - sd_power_usbregstatus_get(&usb_reg); - }else -#endif - { - usb_reg = NRF_POWER->USBREGSTATUS; - } - - if (usb_reg & POWER_USBREGSTATUS_VBUSDETECT_Msk ) - { - tusb_hal_nrf_power_event(NRFX_POWER_USB_EVT_DETECTED); - } - - if (usb_reg & POWER_USBREGSTATUS_OUTPUTRDY_Msk ) - { - tusb_hal_nrf_power_event(NRFX_POWER_USB_EVT_READY); - } - return true; } |
