Arduino-stk500v2-bootloader icon indicating copy to clipboard operation
Arduino-stk500v2-bootloader copied to clipboard

permit start address to be specified in monitor mode.

Open WestfW opened this issue 13 years ago • 1 comments

The attached patch allows one to enter "#3c00 " ('#', followed by a hex number, followed by space (or any non-hex digit, actually)) to set the initial address used by 'E', 'F', and 'R' commands.

WestfW avatar Feb 21 '12 08:02 WestfW

Um. No attachments?

diff --git a/stk500boot.c b/stk500boot.c
index 2c868e2..fef0bf2 100755
--- a/stk500boot.c
+++ b/stk500boot.c
@@ -2020,6 +2020,30 @@ int              ii, jj;
                PrintFromPROGMEMln(gTextMsg_HELP_MSG_AT, 2);
                EEPROMtest();
                break;
+           case '#':
+               gFlashIndex = 0;
+               do {
+                   theChar = recchar();
+                   if (theChar >= 0x60) {
+                       theChar = theChar & 0x5F; // uppercase
+                   }
+                   if (theChar >= 0x20)
+                   {
+                       sendchar(theChar); //echo
+                   }
+
+                   if (theChar >= '0' && theChar <= '9') {
+                       gFlashIndex = 16 * gFlashIndex + (theChar - '0');
+                   } else if (theChar >= 'A' && theChar <= 'F') {
+                       gFlashIndex = 16 * gFlashIndex + 10 + (theChar - 'A');
+                   } else {
+                       break;
+                   }
+               } while (1);
+               PrintNewLine();
+               gRamIndex = gEepromIndex = gFlashIndex;
+               break;
+

            case 'B':
                PrintFromPROGMEMln(gTextMsg_HELP_MSG_B, 2);

WestfW avatar Feb 21 '12 08:02 WestfW