Skip to content

Commit 22be1e0

Browse files
committed
rename to Adafruit_TinyUSB_nRF, add USBD detach/attach
1 parent b188803 commit 22be1e0

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

cores/nRF5/TinyUSB/Adafruit_TinyUSB_Core.cpp renamed to cores/nRF5/TinyUSB/Adafruit_TinyUSB_nRF.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* The MIT License (MIT)
33
*
4-
* Copyright (c) 2018, hathach for Adafruit
4+
* Copyright (c) 2019, hathach for Adafruit
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -54,6 +54,10 @@ static void usb_device_task(void* param)
5454
}
5555
}
5656

57+
//--------------------------------------------------------------------+
58+
// Core Init & Touch1200
59+
//--------------------------------------------------------------------+
60+
5761
// Init usb hardware when starting up. Softdevice is not enabled yet
5862
static void usb_hardware_init(void)
5963
{
@@ -99,7 +103,20 @@ void Adafruit_TinyUSB_Core_touch1200(void)
99103
enterSerialDfu();
100104
}
101105

102-
uint8_t load_serial_number(uint16_t* serial_str)
106+
//--------------------------------------------------------------------+
107+
// Adafruit_USBD_Device platform dependent
108+
//--------------------------------------------------------------------+
109+
void Adafruit_USBD_Device::detach(void)
110+
{
111+
NRF_USBD->USBPULLUP = 0;
112+
}
113+
114+
void Adafruit_USBD_Device::attach(void)
115+
{
116+
NRF_USBD->USBPULLUP = 1;
117+
}
118+
119+
uint8_t Adafruit_USBD_Device::getSerialDescriptor(uint16_t* serial_str)
103120
{
104121
// Serial is 64-bit DeviceID -> 16 chars len
105122
char tmp_serial[17];

0 commit comments

Comments
 (0)