ppravatto / 28C256

A simple, arduino based, low-voltage programmer for the 28C256 EEPROM.
8 stars 2 forks source link

TypeError: list indices must be integers or slices, not tuple #1

Closed Darkstone245 closed 7 months ago

Darkstone245 commented 8 months ago

When writing to the Chip via a binary file, its says that theres a TypeError in line 189: TypeError: list indices must be integers or slices, not tuple. I tried to fix it but i didnt really understand too much of the code. Please help

ppravatto commented 8 months ago

Thank you for pointing out the bug! There is indeed a typo in the code at line 189 where there is a comma , in place of the slicing operator :.

By changing the line to chunk = data[i*MAX_CHUNK_SIZE : (i+1)*MAX_CHUNK_SIZE] the bug should be fixed. The modified code is available in the 1-typeerror-list-indices-must-be-integers-or-slices-not-tuple branch. Let me know if this solves the issue.

ppravatto commented 7 months ago

I have tested the program with a binary file generated with the script:

rom = bytearray([0xea] * 32768)

with open("rom.bin", "wb") as file:
    file.write(rom)

and the program seems to work correctly now. Bug-fix merged into the main branch and the issue closed.