kopia lustrzana https://github.com/peterhinch/micropython_eeprom
eep_i2c.py: Fix cptest path handling.
rodzic
b5e9bcb160
commit
0a1bdce0d2
|
@ -67,9 +67,7 @@ def test(eep=None):
|
||||||
eep[sa + v] = v
|
eep[sa + v] = v
|
||||||
for v in range(256):
|
for v in range(256):
|
||||||
if eep[sa + v] != v:
|
if eep[sa + v] != v:
|
||||||
print(
|
print("Fail at address {} data {} should be {}".format(sa + v, eep[sa + v], v))
|
||||||
"Fail at address {} data {} should be {}".format(sa + v, eep[sa + v], v)
|
|
||||||
)
|
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print("Test of byte addressing passed")
|
print("Test of byte addressing passed")
|
||||||
|
@ -134,8 +132,8 @@ def cptest(eep=None): # Assumes pre-existing filesystem of either type
|
||||||
print("Mounted device.")
|
print("Mounted device.")
|
||||||
cp(__file__, "/eeprom/")
|
cp(__file__, "/eeprom/")
|
||||||
# We may have the source file or a precompiled binary (*.mpy)
|
# We may have the source file or a precompiled binary (*.mpy)
|
||||||
suffix = __file__[__file__.rfind('.'):]
|
# suffix = __file__[__file__.rfind('.'):]
|
||||||
cp("eeprom_i2c" + suffix, "/eeprom/")
|
cp(__file__.replace("eep", "eeprom"), "/eeprom/")
|
||||||
print('Contents of "/eeprom": {}'.format(uos.listdir("/eeprom")))
|
print('Contents of "/eeprom": {}'.format(uos.listdir("/eeprom")))
|
||||||
print(uos.statvfs("/eeprom"))
|
print(uos.statvfs("/eeprom"))
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue