Bladeren bron

Reset checksum after transmitting 20 lines

The checksum should be reset after sending it.
Mateusz Bugdalski 13 jaren geleden
bovenliggende
commit
b52db49866
2 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 1 0
      lpc.c
  2. 1 1
      uucode.c

+ 1 - 0
lpc.c

@@ -125,6 +125,7 @@ void lpc_write_ram(struct lpc_device *dev, const struct sprog_data *d, unsigned
     lpc_printf("%s\r\n", buf);
     if((i % 20)==19) {
       lpc_printf("%u\r\n", checksum);
+      checksum = 0;
       
       if(lpc_getline(reply_buf)) {
 	if(strcmp(reply_buf, "OK\r\n")==0) {

+ 1 - 1
uucode.c

@@ -21,7 +21,7 @@ int uuencode_line(const struct sprog_data *d, char *dst, int *offset, int *check
     *checksum += srcbuf[i];
   }
   
-  for(i=0; (b+i)%3; i++)
+  for(i=0; i<3; i++)
     srcbuf[b+i] = 0;
   
   dst[0] = b;