summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-21 05:36:53 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-21 05:36:53 +0000
commit40b806bfe74e69816ee8f60da133491acadd0a33 (patch)
tree093963abf27c25cd384721bd64d691cc9dcc3981 /src/flash
parent713854f714d7a5777d2e73c580a000dc851ec3f2 (diff)
downloadopenocd_libswd-40b806bfe74e69816ee8f60da133491acadd0a33.tar.gz
openocd_libswd-40b806bfe74e69816ee8f60da133491acadd0a33.tar.bz2
openocd_libswd-40b806bfe74e69816ee8f60da133491acadd0a33.tar.xz
openocd_libswd-40b806bfe74e69816ee8f60da133491acadd0a33.zip
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
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/str9x.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/flash/str9x.c b/src/flash/str9x.c
index 45a3fd67..fbba4fec 100644
--- a/src/flash/str9x.c
+++ b/src/flash/str9x.c
@@ -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 */