From: caternuson Date: Thu, 3 Jan 2019 05:15:04 +0000 (-0800) Subject: add linux detect to busio.UART X-Git-Tag: 1.2.0~1^2~1 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/71d30f8a5889932be3138979f316c2dd0b57b2cb add linux detect to busio.UART --- diff --git a/src/busio.py b/src/busio.py index 61bebab..1e5cd0e 100755 --- a/src/busio.py +++ b/src/busio.py @@ -149,7 +149,10 @@ class UART(Lockable): timeout=1000, receiver_buffer_size=64, flow=None): - from machine import UART as _UART + if detector.board.any_embedded_linux: + raise RuntimeError('busio.UART not supported on this platform.') + else: + from machine import UART as _UART from microcontroller.pin import uartPorts self.baudrate = baudrate