From 3be0ea12f4a50d6fb97f15313f59a187764391ad Mon Sep 17 00:00:00 2001 From: "matthias@rpi" Date: Mon, 4 Dec 2023 21:08:39 +0100 Subject: [PATCH] add option to write all bytes --- eeprom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eeprom.py b/eeprom.py index 42fea59..4e60770 100755 --- a/eeprom.py +++ b/eeprom.py @@ -12,10 +12,10 @@ import atexit gpio_l = [2, 3, 4, 17, 27, 22, 10, 9, 11, 5, 6, 13, 19, 26] gpio_r = [14, 15, 18, 23, 24, 25, 8, 7, 12, 16, 20, 21] + # # Defining which 6502 pin goes to which GPIO pin # - A = [ # 27, 22, 10, 9, 11, 5, 6, 13, 13, 6, 5, 11, 9, 10, 22, 27, # A0 - A7 @@ -278,7 +278,7 @@ def read_byte(address: int, verbose=True, debug=False) -> int: GPIO.output(WEb, 1) setup_io_pins(IN) # set the address valid - ad_bin = set_address(address, bits=15) + set_address(address, bits=15) # low in chip/output enable -> enable GPIO.output(CEb, 0) @@ -426,6 +426,7 @@ def main(): parser.add_argument("--write", "-w", dest="write", action="store_true", default=False, help="write binary file onto the EEPROM") parser.add_argument("--page", "-p", dest="use_page_write", action="store_true", default=False, help="use page write mode") parser.add_argument("--no-validate", dest="validate_write", action="store_false", default=True, help="dont validate write operations") + parser.add_argument("--full", dest="only_diff", action="store_false", default=True, help="write all bytes, not just ones that are mismatched") parser.add_argument("--compare", "-c", dest="compare", action="store_true", default=False, help="compare EEPROM content to binary file") parser.add_argument("--read", "-r", dest="read", action="store_true", default=False, help="read the contents of the EEPROM") parser.add_argument("--erase", "-e", dest="erase", action="store_true", default=False, help="erase the contents of the EEPROM") @@ -453,7 +454,6 @@ def main(): file = read_binary_file(args.file, from_ad=args.from_ad, to_ad=args.to_ad) if args.to_ad != args.from_ad + len(file) - 1: args.to_ad = args.from_ad + len(file) - 1 - else: file = None @@ -463,7 +463,7 @@ def main(): if args.erase: erase(from_ad=args.from_ad, to_ad=args.to_ad, delay=args.delay, debug=args.debug, verbose=True) if args.write: - write(file, from_ad=args.from_ad, delay=args.delay, debug=args.debug, verbose=True, check_written=args.validate_write, use_page_write=args.use_page_write) + write(file, from_ad=args.from_ad, delay=args.delay, debug=args.debug, verbose=True, check_written=args.validate_write, use_page_write=args.use_page_write, only_diff=args.only_diff) if args.read: read(from_ad=args.from_ad, to_ad=args.to_ad, delay=args.delay, debug=args.debug, verbose=True, ignore=args.ignore) if args.compare: