|
@@ -109,6 +109,7 @@ void lpc_write_ram(struct lpc_device *dev, const struct sprog_data *d, unsigned
|
|
|
int checksum;
|
|
|
char buf[64];
|
|
|
int i;
|
|
|
+ int j;
|
|
|
|
|
|
if(d->size & 3)
|
|
|
sprog_error("Invalid data size - should be aligned to 4\n");
|
|
@@ -122,9 +123,9 @@ void lpc_write_ram(struct lpc_device *dev, const struct sprog_data *d, unsigned
|
|
|
sprog_progress((offset*100)/d->size);
|
|
|
checksum = 0;
|
|
|
|
|
|
- for(i=0; uuencode_line(d, buf, &offset, &checksum); i++) {
|
|
|
- lpc_printf("%s\r\n", buf);
|
|
|
- if((i % 20)==19) {
|
|
|
+ for(i=0; (j = uuencode_line(d, buf, &offset, &checksum)); i++) {
|
|
|
+ if(j==1) lpc_printf("%s\r\n", buf);
|
|
|
+ if(j==2 || (i % 20)==19) {
|
|
|
lpc_printf("%u\r\n", checksum);
|
|
|
checksum = 0;
|
|
|
|
|
@@ -132,6 +133,8 @@ void lpc_write_ram(struct lpc_device *dev, const struct sprog_data *d, unsigned
|
|
|
if(strcmp(reply_buf, "OK\r\n")==0) {
|
|
|
last_offset = offset;
|
|
|
last_i = i;
|
|
|
+ if(j==2)
|
|
|
+ offset = -1;
|
|
|
} else {
|
|
|
sprog_error("Received '%s'\n", reply_buf);
|
|
|
offset = last_offset;
|