From dcfac1767f3ff4a82cd9513b36c206d7a4738b65 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Mon, 12 Feb 2018 15:01:29 +0000 Subject: [PATCH] Refs #483. Added watchdog servicing to XcpComputeChecksum(). git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@425 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- Target/Source/xcp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Target/Source/xcp.c b/Target/Source/xcp.c index dca72dee..ea75e64f 100644 --- a/Target/Source/xcp.c +++ b/Target/Source/xcp.c @@ -359,12 +359,16 @@ static blt_int8u XcpComputeChecksum(blt_int32u address, blt_int32u length, /* this example computes the checksum using the add byte to byte algorithm */ while (length-- > 0) { + /* add the next byte value */ cs += *((blt_int8u *)(blt_addr)address); + /* increment address */ address++; + /* service the watchdog */ + CopService(); } - + /* store the computed checksum value */ *checksum = cs; - + /* inform the caller of the uses checksum computation algorithm */ return XCP_CS_ADD11; } /*** end of XcpComputeChecksum ***/