From: hackbard Date: Sat, 4 Aug 2007 23:48:39 +0000 (+0200) Subject: fixed firmware to ram load (should work now!) X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=feece393fb07514608a7ad21eaa376ea3375e945;p=my-code%2Farm.git fixed firmware to ram load (should work now!) --- diff --git a/betty/lpcload.c b/betty/lpcload.c index 6ec1186..0d2f9c8 100644 --- a/betty/lpcload.c +++ b/betty/lpcload.c @@ -317,7 +317,7 @@ int go(t_lpc *lpc) { snprintf(buf,BUFSIZE,"G %d A\r\n",lpc->roff); len=strlen(buf); - ret=txrx(lpc,buf,ret,TXRX_TYPE_CMD); + ret=txrx(lpc,buf,len,TXRX_TYPE_CMD); return ret; } @@ -349,7 +349,7 @@ int write_to_ram(t_lpc *lpc,char *buf,u32 addr,int len) { } /* make it a multiple of 3 (reason: uuencode) */ - nlen=(len/3+1)*3; + nlen=(!(len%3))?len:((len/3+1)*3); if(nlen>BUFSIZE) { printf("ram write: too much data\n"); return -1; @@ -376,7 +376,8 @@ int write_to_ram(t_lpc *lpc,char *buf,u32 addr,int len) { while(bcnt