Update of /cvsroot/lapetus/lapetus
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6061
Modified Files:
commlink.c
Log Message:
-Fixed a bug causing checksum issues
Index: commlink.c
===================================================================
RCS file: /cvsroot/lapetus/lapetus/commlink.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- commlink.c 13 Feb 2007 20:26:38 -0000 1.1
+++ commlink.c 9 Nov 2007 00:38:13 -0000 1.2
@@ -163,6 +163,8 @@
{
case 0x01:
{
+ u8 chksum;
+
// Download Memory
CLSendLong(val);
@@ -191,19 +193,19 @@
if (size == 0)
break;
- data = 0;
+ chksum = 0;
while (size > 0)
{
- data += *((volatile u8 *)addr);
- data &= 0xFF;
- CLExchangeByte(*((volatile u8 *)addr));
+ data = *((volatile u8 *)addr);
+ chksum += data;
+ CLExchangeByte(data);
addr++;
size--;
}
// Send the checksum
- CLExchangeByte(data);
+ CLExchangeByte(chksum);
}
CLExchangeByte('0');
|