Skip to content
Open
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
13 changes: 12 additions & 1 deletion src/NeoSWSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void NeoSWSerial::listen()
if (listener)
listener->ignore();

pinMode(rxPin, INPUT);
pinMode(rxPin, INPUT_PULLUP);
rxBitMask = digitalPinToBitMask( rxPin );
rxPort = portInputRegister( digitalPinToPort( rxPin ) );

Expand Down Expand Up @@ -268,6 +268,17 @@ int NeoSWSerial::available()

//----------------------------------------------------------------------------

int NeoSWSerial::peek(void)
{
if (rxHead == rxTail) {
return -1;
} else {
return rxBuffer[rxTail];
}
} // peek

//----------------------------------------------------------------------------

int NeoSWSerial::read()
{
if (rxHead == rxTail) return -1;
Expand Down