projects
/
my-code
/
arm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
203e912
)
more fw2ram stuff (not yet finished)
author
hackbard
<hackbard@hackdaworld.org>
Sun, 29 Jul 2007 23:12:40 +0000
(
01:12
+0200)
committer
hackbard
<hackbard@hackdaworld.org>
Sun, 29 Jul 2007 23:12:40 +0000
(
01:12
+0200)
betty/lpcload.c
patch
|
blob
|
history
diff --git
a/betty/lpcload.c
b/betty/lpcload.c
index
7c2db70
..
0bf3006
100644
(file)
--- a/
betty/lpcload.c
+++ b/
betty/lpcload.c
@@
-371,7
+371,27
@@
int write_to_ram(t_lpc *lpc,u8 *buf,int addr,int len) {
int firmware_to_ram(t_lpc *lpc) {
int firmware_to_ram(t_lpc *lpc) {
+ char line[BUFSIZE];
+ char buf[BUFSIZE];
+
+ /* read file */
+ while(ret) {
+ /* read line */
+ while(ret) {
+ ret=read(lpc->fwfd,line,1);
+ if(line[0]!=':') {
+ printf("fw to ram: no ihex format\n");
+ return -1;
+ }
+ ret=read(lpc->fwfd,line+1,2);
+ line[3]='\0';
+ len=atoi(line+1);
+ ret=read(lpc->fwfd,line+3,4);
+ line[7]='\0';
+ addr=strtol(line+3);
+ }
+ }
return 0;
}
return 0;
}