• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂3c7279492996a0bba0b98d175e6db6e3f1437ba0 (tree)
時間2021-06-05 00:10:06
作者Yoshinori Sato <yo-satoh@sios...>
CommiterYoshinori Sato

Log Message

fix some error.

Change Summary

差異

--- a/comm.c
+++ b/comm.c
@@ -550,12 +550,14 @@ static int skipcheck(unsigned char *data, unsigned short size)
550550 static int write_rom(struct port_t *port, struct arealist_t *arealist, enum mat_t mat)
551551 {
552552 unsigned char *buf = NULL;
553+ unsigned char cmdbuf[32];
553554 unsigned int romaddr;
554555 int i;
555556 struct area_t *area;
556557
557558 puts("Erase flash...");
558559 /* enter writemode */
560+ buf = cmdbuf;
559561 buf[0] = WRITEMODE;
560562 send(port, buf, 1);
561563 if (receive(port, buf) != 1) {
@@ -625,6 +627,7 @@ static int write_rom(struct port_t *port, struct arealist_t *arealist, enum mat_
625627 }
626628 }
627629 /* write finish */
630+ buf = cmdbuf;
628631 *(buf + 0) = WRITE;
629632 memset(buf + 1, 0xff, 4);
630633 send(port, buf, 5);
@@ -635,9 +638,9 @@ static int write_rom(struct port_t *port, struct arealist_t *arealist, enum mat_
635638 if (!verbose)
636639 putc('\n', stdout);
637640
638- return 1;
639- error:
640641 return 0;
642+ error:
643+ return 1;
641644 }
642645
643646 /* connect to target chip */
--- a/compile
+++ b/compile
@@ -1 +1 @@
1-/usr/share/automake-1.14/compile
\ No newline at end of file
1+/usr/share/automake-1.16/compile
\ No newline at end of file
--- a/main.c
+++ b/main.c
@@ -21,6 +21,7 @@
2121 #include <errno.h>
2222 #include <sys/mman.h>
2323 #include <sys/stat.h>
24+#include <unistd.h>
2425 #ifdef HAVE_GELF_H
2526 #include <gelf.h>
2627 #endif
@@ -81,7 +82,7 @@ static int write_binary(FILE *fp, struct comm_t *com,
8182 area = lookup_area(arealist, addr);
8283 len = bin_len < (area->end - area->start)?
8384 bin_len:(area->end - area->start);
84- if (len > read(area->image, len, fno))
85+ if (len > read(fno, area->image, len))
8586 goto error_perror;
8687 bin_len -= len;
8788 addr += len;
--- a/serial.c
+++ b/serial.c
@@ -188,7 +188,7 @@ struct port_t *open_serial(char *ser_port)
188188
189189 ser_fd = open(ser_port, O_RDWR);
190190 if (ser_fd == -1) {
191- perror("PROGNAME: ");
191+ perror(PROGNAME ": port open failed");
192192 return NULL;
193193 }
194194