summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
authorhathach <thach@tinyusb.org>2019-01-30 22:30:23 +0700
committerhathach <thach@tinyusb.org>2019-01-30 22:30:23 +0700
commita51f2b07161239e0a3805cb40914f159f2038c87 (patch)
tree9bfa06732cd34a724eddfe6c1bd00fb88fd9359f /supervisor
parent164e1e23419450ac8cd72af01051ec6fd299bd92 (diff)
refactor nrfx from supervisor/usb.c
Diffstat (limited to 'supervisor')
-rw-r--r--supervisor/shared/usb/usb.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c
index d15e1c4ff..136137f77 100644
--- a/supervisor/shared/usb/usb.c
+++ b/supervisor/shared/usb/usb.c
@@ -32,19 +32,8 @@
#include "lib/utils/interrupt_char.h"
#include "lib/mp-readline/readline.h"
-#include "nrfx_power.h"
-
-#ifdef SOFTDEVICE_PRESENT
-#include "nrf_sdm.h"
-#include "nrf_soc.h"
-#endif
-
#include "tusb.h"
-// tinyusb function that handles power event (detected, ready, removed)
-// We must call it within SD's SOC event handler, or set it as power event handler if SD is not enabled.
-extern void tusb_hal_nrf_power_event(uint32_t event);
-
// Serial number as hex characters. This writes directly to the USB
// descriptor.
extern uint16_t usb_serial_number[1 + COMMON_HAL_MCU_PROCESSOR_UID_LENGTH * 2];
@@ -71,30 +60,6 @@ bool usb_enabled(void) {
void usb_init(void) {
init_usb_hardware();
-
- // USB power may already be ready at this time -> no event generated
- // We need to invoke the handler based on the status initially
- uint32_t usb_reg;
-
-#ifdef SOFTDEVICE_PRESENT
- uint8_t sd_en = false;
- (void) sd_softdevice_is_enabled(&sd_en);
-
- if ( sd_en ) {
- sd_power_usbregstatus_get(&usb_reg);
- }else {
- 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);
- }
-#endif
-
load_serial_number();
tusb_init();