No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

log.py 367B

12345678910111213141516
  1. # https://forum.micropython.org/viewtopic.php?t=5442
  2. import io
  3. class LogDup(io.IOBase):
  4. def __init__(self):
  5. self.data = bytearray()
  6. def write(self, data):
  7. self.data += data
  8. if len(self.data) > 1024:
  9. self.data = self.data[len(self.data) - 1024 : ]
  10. return len(data)
  11. def readinto(self, data):
  12. return 0