mirror of https://github.com/FOME-Tech/openblt.git
git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@892 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
parent
cab852ee9e
commit
f346ba9546
|
@ -401,7 +401,7 @@ static bool XcpLoaderStart(void)
|
|||
{
|
||||
keyCurrentLen = (xcpMaxCto - 2);
|
||||
}
|
||||
/* The the (possible partial) unlock command. */
|
||||
/* Send the (possible partial) unlock command. */
|
||||
if (!XcpLoaderSendCmdUnlock(keyPtr, keyRemainingLen, ¤tlyProtectedResources))
|
||||
{
|
||||
result = false;
|
||||
|
@ -921,7 +921,7 @@ static bool XcpLoaderSendCmdGetSeed(uint8_t resource, uint8_t mode, uint8_t * se
|
|||
if (result)
|
||||
{
|
||||
/* Check if the response was valid. */
|
||||
if ( (resPacket.len <= 2) || (resPacket.len > xcpMaxCto) ||
|
||||
if ( (resPacket.len <= 2) || (resPacket.len > xcpMaxDto) ||
|
||||
(resPacket.data[0] != XCPLOADER_CMD_PID_RES) )
|
||||
{
|
||||
/* Not a valid or positive response. */
|
||||
|
@ -935,9 +935,9 @@ static bool XcpLoaderSendCmdGetSeed(uint8_t resource, uint8_t mode, uint8_t * se
|
|||
*seedLen = resPacket.data[1];
|
||||
/* Determine the number of seed bytes in the current response */
|
||||
currentSeedLen = *seedLen;
|
||||
if (currentSeedLen > (xcpMaxCto - 2))
|
||||
if (currentSeedLen > ((uint8_t)xcpMaxDto - 2))
|
||||
{
|
||||
currentSeedLen = (xcpMaxCto - 2);
|
||||
currentSeedLen = ((uint8_t)xcpMaxDto - 2);
|
||||
}
|
||||
/* Store the seed bytes. */
|
||||
for (uint8_t idx = 0; idx < currentSeedLen; idx++)
|
||||
|
|
Binary file not shown.
|
@ -1012,9 +1012,9 @@ static void XcpCmdGetSeed(blt_int8u *data)
|
|||
}
|
||||
/* determine number of seed bytes that fit in the first response */
|
||||
seedCurrentLen = seedRemainderLen;
|
||||
if (seedCurrentLen > (XCP_CTO_PACKET_LEN-2))
|
||||
if (seedCurrentLen > (XCP_DTO_PACKET_LEN-2))
|
||||
{
|
||||
seedCurrentLen = XCP_CTO_PACKET_LEN-2;
|
||||
seedCurrentLen = XCP_DTO_PACKET_LEN-2;
|
||||
}
|
||||
/* store the first part of the seed in the response */
|
||||
CpuMemCopy((blt_addr)(&xcpInfo.ctoData[2]), (blt_addr)seedCurrentPtr, seedCurrentLen);
|
||||
|
|
Loading…
Reference in New Issue