summaryrefslogtreecommitdiff
path: root/tests/pyb/i2c.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-06-08 13:00:27 +1000
committerDamien George <damien.p.george@gmail.com>2018-06-08 13:00:27 +1000
commita12d046c42dc7e786563f8247ed8aa8ac6e14a47 (patch)
treef8adf0894fa2548dce2cbcad6e5aecbcfa2bca40 /tests/pyb/i2c.py
parent190c7dba89dbb1165f682b56f278e3bc9715680c (diff)
tests/pyb: Make i2c and pyb1 pyboard tests run again.
For i2c.py: the accelerometer now uses the new I2C driver so need to explicitly init the legacy i2c object to get the test working. For pyb1.py: the legacy pyb.hid() call will crash if the USB_HID object is not initialised.
Diffstat (limited to 'tests/pyb/i2c.py')
-rw-r--r--tests/pyb/i2c.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py
index a220f8e85..6875e5a5a 100644
--- a/tests/pyb/i2c.py
+++ b/tests/pyb/i2c.py
@@ -19,7 +19,8 @@ i2c.deinit()
accel_addr = 76
-pyb.Accel() # this will init the bus for us
+pyb.Accel() # this will init the MMA for us
+i2c.init(I2C.MASTER, baudrate=400000)
print(i2c.scan())
print(i2c.is_ready(accel_addr))