From 3532c567ac68524ae35bc0effb3f5f76bb115a75 Mon Sep 17 00:00:00 2001 From: MCUdude Date: Sun, 20 Feb 2022 22:23:15 +0100 Subject: [PATCH] Add suffix for 8-bit data use [val]HH or [val]hh to force 8-bit writes to memory --- src/term.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/term.c b/src/term.c index 773f6d35..2129643e 100644 --- a/src/term.c +++ b/src/term.c @@ -424,9 +424,14 @@ static int cmd_write(PROGRAMMER * pgm, struct avrpart * p, } else if (suffix == 'L' || suffix == 'l') { argv[i][strlen(argv[i]) - 1] = '\0'; data.size = 4; - } else if ((suffix == 'F' || suffix == 'f') && strncmp(argv[i], "0x", 2) != 0) { + } else if ((suffix == 'F' || suffix == 'f') && + strncmp(argv[i], "0x", 2) != 0 && strncmp(argv[i], "-0x", 3) != 0) { argv[i][strlen(argv[i]) - 1] = '\0'; + avrdude_message(MSG_INFO, "snip\n"); data.size = 4; + } else if ((suffix == 'H' && lsuffix == 'H') || (suffix == 'h' && lsuffix == 'h')) { + argv[i][strlen(argv[i]) - 2] = '\0'; + data.size = 1; } else if (suffix == 'H' || suffix == 'h' || suffix == 'S' || suffix == 's') { argv[i][strlen(argv[i]) - 1] = '\0'; data.size = 2;