diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pyb/can.py | 9 | ||||
-rw-r--r-- | tests/pyb/can.py.exp | 6 |
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/pyb/can.py b/tests/pyb/can.py index 931578bc5..923a83860 100644 --- a/tests/pyb/can.py +++ b/tests/pyb/can.py @@ -1,8 +1,12 @@ from pyb import CAN -can = CAN(1, CAN.LOOPBACK) +can = CAN(1) +print(can) + +can.init(CAN.LOOPBACK) print(can) print(can.any(0)) + can.send('abcd', 123) print(can.any(0)) print(can.recv(0)) @@ -37,6 +41,3 @@ else: print('passed') else: print('failed, wrong data received') - - -print('end')
\ No newline at end of file diff --git a/tests/pyb/can.py.exp b/tests/pyb/can.py.exp index d12643a5f..405820204 100644 --- a/tests/pyb/can.py.exp +++ b/tests/pyb/can.py.exp @@ -1,10 +1,10 @@ -CAN(1, LOOPBACK, False) +CAN(1) +CAN(1, CAN.LOOPBACK, extframe=False) False True (123, 0, 0, b'abcd') (2047, 0, 0, b'abcd') (0, 0, 0, b'abcd') passed -CAN(1, LOOPBACK, True) +CAN(1, CAN.LOOPBACK, extframe=True) passed -end |