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.
This commit is contained in:
parent
190c7dba89
commit
a12d046c42
|
@ -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))
|
||||
|
|
|
@ -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()))
|
||||
|
|
Loading…
Reference in New Issue