From 71d30f8a5889932be3138979f316c2dd0b57b2cb Mon Sep 17 00:00:00 2001 From: caternuson Date: Wed, 2 Jan 2019 21:15:04 -0800 Subject: [PATCH] add linux detect to busio.UART --- src/busio.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.49.0