Skip to content

Using available defines instead of hardcoded values within USB stack #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2019
Merged
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
6 changes: 3 additions & 3 deletions cores/arduino/USB/CDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ bool Serial_::setup(USBSetup& setup)
// auto-reset into the bootloader is triggered when the port, already
// open at 1200 bps, is closed. We check DTR state to determine if host
// port is open (bit 0 of lineState).
if (_usbLineInfo.dwDTERate == 1200 && (_usbLineInfo.lineState & 0x01) == 0)
if (_usbLineInfo.dwDTERate == 1200 && (_usbLineInfo.lineState & CDC_LINESTATE_DTR) == 0)
{
initiateReset(250);
}
Expand Down Expand Up @@ -326,11 +326,11 @@ uint8_t Serial_::numbits() {
}

bool Serial_::dtr() {
return _usbLineInfo.lineState & 0x1;
return ((_usbLineInfo.lineState & CDC_LINESTATE_DTR) == CDC_LINESTATE_DTR);
}

bool Serial_::rts() {
return _usbLineInfo.lineState & 0x2;
return ((_usbLineInfo.lineState & CDC_LINESTATE_RTS) == CDC_LINESTATE_RTS);
}

Serial_ SerialUSB(USBDevice);
Expand Down