Skip to content

Commit d8a904f

Browse files
authored
Update HardwareSerial.cpp
1 parent 1e2b0ff commit d8a904f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cores/arduino/HardwareSerial.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ int HardwareSerial::peek(void)
177177
}
178178
}
179179

180+
int HardwareSerial::peekLast(void)
181+
{
182+
return _rx_buffer_head==_rx_buffer_tail ? -1 : _rx_buffer[(SERIAL_RX_BUFFER_SIZE+_rx_buffer_tail-1)%SERIAL_RX_BUFFER_SIZE];
183+
}
184+
180185
int HardwareSerial::read(void)
181186
{
182187
// if the head isn't ahead of the tail, we don't have any characters

0 commit comments

Comments
 (0)