OSDN Git Service

[SRECORD] Change footer "S9" to "S8". Address expression is 24bit.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 8 Nov 2013 04:04:01 +0000 (13:04 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 8 Nov 2013 04:04:01 +0000 (13:04 +0900)
shell_strutl.c

index 296820f..2fcaf7b 100644 (file)
@@ -138,7 +138,7 @@ char str_shex2bin(unsigned char *s, unsigned char *p, unsigned long *addr, unsig
     unsigned char c;
     // Get Header
     if(s[0] != 'S')  return TERM_NONSREC;
-    if(s[1] == '2') { //  Data coire
+    if(s[1] == '2') { //  Data core
         for(i = 2; i < 8; i += 2) if(migrate_hex(&s[i]) == 0) return TERM_SRECERR;
         bytes = hex2byte(&s[2]);
         if(bytes <= 4) return TERM_SRECERR;
@@ -274,11 +274,11 @@ unsigned char str_put_shexfooter(unsigned char *s)
     unsigned char pp;
     unsigned char sum;
     s[0] = 'S';
-    s[1] = '9';
+    s[1] = '8';
     s[2] = '0';
-    s[3] = '3';
-    sum = 3;
-    for(pp = 4; pp < 8; pp++) s[pp] = '0';
+    s[3] = '4';
+    sum = 4;
+    for(pp = 4; pp < 10; pp++) s[pp] = '0';
     sum = ~sum;
     bin2hex(&s[pp], sum);