Skip to content

Commit

Permalink
Add support for partitions on multi-address eeproms
Browse files Browse the repository at this point in the history
  • Loading branch information
b0xcat committed May 5, 2024
1 parent b445860 commit f25d144
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/system/hexpansion/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ def get_hexpansion_block_devices(i2c, header, addr=0x50):
chip_size=header.eeprom_total_size,
page_size=header.eeprom_page_size,
addr=addr)

n_chips = eep._a_bytes // eep._c_bytes

partition = EEPROMPartition(eep=eep,
offset=header.fs_offset,
length=header.eeprom_total_size - header.fs_offset)
length=(header.eeprom_total_size * n_chips) - header.fs_offset)
print("eeprom block count:", eep.ioctl(4, None))
print("partition block count:", partition.ioctl(4, None))
print("partition block size:", partition.ioctl(5, None))
Expand Down

0 comments on commit f25d144

Please sign in to comment.