Skip to content

Commit 3b38a41

Browse files
facchinmcmaglie
authored andcommitted
Inplement USBDevice.end()
1 parent d5557ec commit 3b38a41

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cores/arduino/USB/USBAPI.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class USBDeviceClass {
5858

5959
// USB Device API
6060
void init();
61+
bool end();
6162
bool attach();
6263
bool detach();
6364
void setAddress(uint32_t addr);

cores/arduino/USB/USBCore.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,13 @@ bool USBDeviceClass::detach()
387387
return true;
388388
}
389389

390+
bool USBDeviceClass::end() {
391+
if (!initialized)
392+
return false;
393+
usbd.disable();
394+
return true;
395+
}
396+
390397
bool USBDeviceClass::configured()
391398
{
392399
return _usbConfiguration != 0;

0 commit comments

Comments
 (0)