summaryrefslogtreecommitdiffstatshomepage
path: root/tests/pyb/halerror.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pyb/halerror.py')
-rw-r--r--tests/pyb/halerror.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pyb/halerror.py b/tests/pyb/halerror.py
new file mode 100644
index 0000000000..1a6bce1a7e
--- /dev/null
+++ b/tests/pyb/halerror.py
@@ -0,0 +1,15 @@
+# test hal errors
+
+import pyb
+
+i2c = pyb.I2C(2, pyb.I2C.MASTER)
+try:
+ i2c.recv(1, 1)
+except OSError as e:
+ print(repr(e))
+
+can = pyb.CAN(1, pyb.CAN.NORMAL)
+try:
+ can.send('1', 1, timeout=50)
+except OSError as e:
+ print(repr(e))