From 224fee0e1080fa7cd654de240c32c8433bb07cf9 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 15 Nov 2014 20:39:44 +0000 Subject: stmhal: Fix HAL error raising; make test for it. Addresses issue #968. --- tests/pyb/halerror.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/pyb/halerror.py (limited to 'tests/pyb/halerror.py') 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)) -- cgit v1.2.3