Skip to content

Commit

Permalink
Merge pull request #3 from todbot/main
Browse files Browse the repository at this point in the history
adafruit_pio_uart.receive() should return None on no bytes received
  • Loading branch information
FoamyGuy authored Oct 12, 2024
2 parents 8442c9c + 981bdc7 commit dbd647b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions adafruit_pio_uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ def read(self, n):
else:
buf = bytearray(n)
n = self.readinto(buf)
if n == 0:
return None
if n < len(buf):
return buf[:n]
return buf
Expand Down

0 comments on commit dbd647b

Please sign in to comment.