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.
pull/3838/merge
Damien George 2018-06-08 13:00:27 +10:00
rodzic 190c7dba89
commit a12d046c42
2 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -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))

Wyświetl plik

@ -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()))