TomNisbet / TommyPROM

Simple Arduino-based EEPROM programmer
https://tomnisbet.github.io/TommyPROM/
143 stars 29 forks source link

Use chip size for selected commands where it makes sense #70

Closed jscrane closed 4 months ago

jscrane commented 4 months ago

See discussion.

jscrane commented 4 months ago

Do we want to check if start > prom.end() and maybe reset to 0 if it is?

TomNisbet commented 4 months ago

Maybe not a good idea to adjust back to zero. If I want to fill from 200 to 2ff and accidentally type 2000 to 2ff it would be better that it fails instead of filling 0 to 2ff.

I routinely take advantage of the fact that the Dump command does not enforce the prom size by using the default 28C code to read larger EPROMs. The documentation states that most chips can be read with with default code, so it would be good to leave that as is. It does mean that the code will happily dump 8K of data from a 2K chip.

jscrane commented 4 months ago

OK, I will run some more manual tests on my current branch soon.

Is there anything that's a must-have before merging this PR?

TomNisbet commented 4 months ago

I can’t think of anything else. Looks good.

jscrane commented 4 months ago

The last commit moves start, end and val to the stack and uses next to retain state for a subsequent d command on its own.

The reason for this was that if you dumped a page, then computed the checksum w/o args, it would checksum from the saved start position. This is probably not what is desired.

TomNisbet commented 4 months ago

Looks great! Are you ready to merge or still working on it?

jscrane commented 4 months ago

I'm done now: feel free to merge! (That last change was really just cosmetic.)