Skip to content
Snippets Groups Projects
Commit 40b806bf authored by oharboe's avatar oharboe
Browse files

Zach Welch <zw@superlucidity.net> fix str9x type-punned pointer

git-svn-id: svn://svn.berlios.de/openocd/trunk@1484 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 713854f7
No related branches found
No related tags found
No related merge requests found
......@@ -194,6 +194,7 @@ static int str9x_protect_check(struct flash_bank_s *bank)
int i;
u32 adr;
u32 status = 0;
u16 hstatus = 0;
if (bank->target->state != TARGET_HALTED)
{
......@@ -212,10 +213,11 @@ static int str9x_protect_check(struct flash_bank_s *bank)
{
return retval;
}
if ((retval=target_read_u16(target, adr, (u16*)&status))!=ERROR_OK)
if ((retval=target_read_u16(target, adr, &hstatus))!=ERROR_OK)
{
return retval;
}
status = hstatus;
}
else
{
......@@ -237,10 +239,11 @@ static int str9x_protect_check(struct flash_bank_s *bank)
{
return retval;
}
if ((retval=target_read_u16(target, adr, (u16*)&status))!=ERROR_OK)
if ((retval=target_read_u16(target, adr, &hstatus))!=ERROR_OK)
{
return retval;
}
status = hstatus;
}
/* read array command */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment