Skip to content

Commit 5bec4ae

Browse files
authored
Merge pull request #19 from MicrochipTech/bugfix/set-xdata-fix
BugFix: ini2bin fails to append SET_XDATA_ADDRESS in bin
2 parents 0222a73 + 5421dbf commit 5bec4ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ini.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,10 @@ int switchtec_convert_ini2bin(FILE *szINIFileName, char *pclog ,BYTE *m_pBinConf
437437
BYTE byPrevXMode = SET_XMODE_NONE;
438438
BYTE byCurrXMode = SET_XMODE_NONE;
439439
unsigned int nTemp = 0;
440-
DWORD dwCurrAddress = 0, dwPrevAddress = 0;
440+
// This fix is required for appending - 0x80(SET_XDATA_ADDRESS) in binary due to the following condition,
441+
// if ((dwCurrAddress < dwPrevAddress) || (wTemp > 0x7D))
442+
// So, dwPrevAddress need to be initialied to 0Xffffffff
443+
DWORD dwCurrAddress = 0, dwPrevAddress = 0xFFFFFFFF;
441444
BYTE byPatchCount = 0;
442445
BOOL bValidDataOffset = FALSE;
443446
WORD wDataLengthOffset = 0;

0 commit comments

Comments
 (0)