Skip to content

Commit e0e677e

Browse files
aentingerturmary
authored andcommitted
Using available defines/constants instead of hardcoded values for linestate
1 parent 812819f commit e0e677e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cores/arduino/USB/CDC.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ bool CDC_Setup(USBSetup &setup)
119119
// auto-reset into the bootloader is triggered when the port, already
120120
// open at 1200 bps, is closed. We check DTR state to determine if host
121121
// port is open (bit 0 of lineState).
122-
if (_usbLineInfo.dwDTERate == 1200 && (_usbLineInfo.lineState & 0x01) == 0)
122+
if (_usbLineInfo.dwDTERate == 1200 && (_usbLineInfo.lineState & CDC_LINESTATE_DTR) == 0)
123123
{
124124
initiateReset(250);
125125
}
@@ -278,12 +278,12 @@ uint8_t Serial_::numbits()
278278

279279
bool Serial_::dtr()
280280
{
281-
return _usbLineInfo.lineState & 0x1;
281+
return _usbLineInfo.lineState & CDC_LINESTATE_DTR;
282282
}
283283

284284
bool Serial_::rts()
285285
{
286-
return _usbLineInfo.lineState & 0x2;
286+
return _usbLineInfo.lineState & CDC_LINESTATE_RTS;
287287
}
288288

289289
// This operator is a convenient way for a sketch to check whether the

0 commit comments

Comments
 (0)