Skip to content

Commit 981bdc7

Browse files
committed
adafruit_pio_uart.receive() should return None on no bytes received (timeout), to match busio.UART
1 parent 8442c9c commit 981bdc7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adafruit_pio_uart.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ def read(self, n):
184184
else:
185185
buf = bytearray(n)
186186
n = self.readinto(buf)
187+
if n == 0:
188+
return None
187189
if n < len(buf):
188190
return buf[:n]
189191
return buf

0 commit comments

Comments
 (0)