From efc49c5591d23f606a2e6203f9b4e4976aa3e6e3 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 30 Oct 2014 23:13:53 +0000 Subject: stmhal: Improve CAN print function. --- tests/pyb/can.py | 9 +++++---- tests/pyb/can.py.exp | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3