diff --git a/drivers/sdcard/sdtest.py b/drivers/sdcard/sdtest.py index 438baa245d..01fe65aa94 100644 --- a/drivers/sdcard/sdtest.py +++ b/drivers/sdcard/sdtest.py @@ -1,10 +1,13 @@ # Test for sdcard block protocol # Peter hinch 30th Jan 2016 -import os, sdcard, pyb +import os, sdcard, machine def sdtest(): - sd = sdcard.SDCard(pyb.SPI(1), pyb.Pin.board.X21) # Compatible with PCB - pyb.mount(sd, '/fc') + spi = machine.SPI(1) + spi.init() # Ensure right baudrate + sd = sdcard.SDCard(spi, machine.Pin.board.X21) # Compatible with PCB + vfs = os.VfsFat(sd) + os.mount(vfs, '/fc') print('Filesystem check') print(os.listdir('/fc')) @@ -38,7 +41,7 @@ def sdtest(): result2 = f.read() print(len(result2), 'bytes read') - pyb.mount(None, '/fc') + os.umount('/fc') print() print('Verifying data read back')