This commit is contained in:
hathach 2018-05-14 14:20:37 +07:00
parent e30392251a
commit cb310027b6
2 changed files with 16 additions and 5 deletions

@ -1 +1 @@
Subproject commit f25cf35634650dabc9fdd493eb563f2c88299b3e Subproject commit 03d442a86124d759f294828b46ad134f3e2f18dc

View File

@ -602,11 +602,22 @@ uint32_t proc_soc(void)
if (NRF_SUCCESS == err) if (NRF_SUCCESS == err)
{ {
// from hal_nrf5x.c
extern void power_usb_event_handler(uint32_t evt);
pstorage_sys_event_handler(soc_evt); pstorage_sys_event_handler(soc_evt);
power_usb_event_handler(soc_evt);
/*------------- usb power event handler -------------*/
extern void tusb_hal_nrf_power_event(uint32_t evt);
enum // TODO remove when migrating to SDK15
{
NRFX_POWER_USB_EVT_DETECTED = 0,
NRFX_POWER_USB_EVT_REMOVED,
NRFX_POWER_USB_EVT_READY
};
int32_t usbevt = (soc_evt == NRF_EVT_POWER_USB_DETECTED ) ? NRFX_POWER_USB_EVT_DETECTED:
(soc_evt == NRF_EVT_POWER_USB_POWER_READY) ? NRFX_POWER_USB_EVT_READY :
(soc_evt == NRF_EVT_POWER_USB_REMOVED ) ? NRFX_POWER_USB_EVT_REMOVED : -1;
if ( usbevt >= 0) tusb_hal_nrf_power_event(usbevt);
} }
return err; return err;