summaryrefslogtreecommitdiffstatshomepage
path: root/tests/pyb/halerror.py
blob: 1a6bce1a7ef9daed786d23dd0b7a7e8df834c554 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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))