From a12d046c42dc7e786563f8247ed8aa8ac6e14a47 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 8 Jun 2018 13:00:27 +1000 Subject: [PATCH] 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. --- tests/pyb/i2c.py | 3 ++- tests/pyb/pyb1.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py index a220f8e858..6875e5a5aa 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)) diff --git a/tests/pyb/pyb1.py b/tests/pyb/pyb1.py index 184acbdc43..443722ca85 100644 --- a/tests/pyb/pyb1.py +++ b/tests/pyb/pyb1.py @@ -29,8 +29,6 @@ pyb.enable_irq() print(pyb.have_cdc()) -pyb.hid((0, 0, 0, 0)) # won't do anything - pyb.sync() print(len(pyb.unique_id()))