Bladeren bron

Fix the progress bar

If offset==-1, then the transmission is complete and we set progress bar to 100%.
Mateusz Bugdalski 13 jaren geleden
bovenliggende
commit
4b59ad7375
1 gewijzigde bestanden met toevoegingen van 5 en 4 verwijderingen
  1. 5 4
      lpc.c

+ 5 - 4
lpc.c

@@ -136,18 +136,19 @@ void lpc_write_ram(struct lpc_device *dev, const struct sprog_data *d, unsigned
 	  if(j==2)
 	    offset = -1;
 	} else {
-	  sprog_error("Received '%s'\n", reply_buf);
 	  offset = last_offset;
 	  i = last_i;
 	}
       } else
 	break;
     }
-    
-    sprog_progress((offset*100)/d->size);
+    if(offset!=-1)
+      sprog_progress((offset*100)/d->size);
+    else
+      sprog_progress(100);
   }
   
-  if(offset!=d->size)
+  if(offset!=-1)
     sprog_error("Error while writing to RAM\n");
 }