Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cores/arduino/USB/CDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ void Serial_::begin(uint32_t /* baud_count */, uint8_t /* config */)

void Serial_::end(void)
{
memset((void*)&_usbLineInfo, 0, sizeof(_usbLineInfo));
}

int Serial_::available(void)
Expand Down
1 change: 1 addition & 0 deletions cores/arduino/USB/USBAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class USBDeviceClass {

// USB Device API
void init();
bool end();
bool attach();
bool detach();
void setAddress(uint32_t addr);
Expand Down
7 changes: 7 additions & 0 deletions cores/arduino/USB/USBCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,13 @@ bool USBDeviceClass::detach()
return true;
}

bool USBDeviceClass::end() {
if (!initialized)
return false;
usbd.disable();
return true;
}

bool USBDeviceClass::configured()
{
return _usbConfiguration != 0;
Expand Down