ooops... fixed commit gaffe in previous commit.
git-svn-id: svn://svn.berlios.de/openocd/trunk@971 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
parent
e5181df1d4
commit
113436df6f
|
@ -306,8 +306,8 @@ int str9x_erase(struct flash_bank_s *bank, int first, int last)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i;
|
int timeout;
|
||||||
for (i=0; i<1000; i++) {
|
for (timeout=0; timeout<1000; timeout++) {
|
||||||
if ((retval=target_read_u8(target, adr, &status))!=ERROR_OK)
|
if ((retval=target_read_u8(target, adr, &status))!=ERROR_OK)
|
||||||
{
|
{
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -316,7 +316,7 @@ int str9x_erase(struct flash_bank_s *bank, int first, int last)
|
||||||
break;
|
break;
|
||||||
alive_sleep(1);
|
alive_sleep(1);
|
||||||
}
|
}
|
||||||
if (i==1000)
|
if (timeout==1000)
|
||||||
{
|
{
|
||||||
LOG_ERROR("erase timed out");
|
LOG_ERROR("erase timed out");
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
@ -578,15 +578,15 @@ int str9x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
|
||||||
/* get status command */
|
/* get status command */
|
||||||
target_write_u16(target, bank_adr, 0x70);
|
target_write_u16(target, bank_adr, 0x70);
|
||||||
|
|
||||||
int i;
|
int timeout;
|
||||||
for (i=0; i<1000; i++)
|
for (timeout=0; timeout<1000; timeout++)
|
||||||
{
|
{
|
||||||
target_read_u8(target, bank_adr, &status);
|
target_read_u8(target, bank_adr, &status);
|
||||||
if( status & 0x80 )
|
if( status & 0x80 )
|
||||||
break;
|
break;
|
||||||
alive_sleep(1);
|
alive_sleep(1);
|
||||||
}
|
}
|
||||||
if (i==1000)
|
if (timeout==1000)
|
||||||
{
|
{
|
||||||
LOG_ERROR("write timed out");
|
LOG_ERROR("write timed out");
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
@ -627,15 +627,15 @@ int str9x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
|
||||||
/* query status command */
|
/* query status command */
|
||||||
target_write_u16(target, bank_adr, 0x70);
|
target_write_u16(target, bank_adr, 0x70);
|
||||||
|
|
||||||
int i;
|
int timeout;
|
||||||
for (i=0; i<1000; i++)
|
for (timeout=0; timeout<1000; timeout++)
|
||||||
{
|
{
|
||||||
target_read_u8(target, bank_adr, &status);
|
target_read_u8(target, bank_adr, &status);
|
||||||
if( status & 0x80 )
|
if( status & 0x80 )
|
||||||
break;
|
break;
|
||||||
alive_sleep(1);
|
alive_sleep(1);
|
||||||
}
|
}
|
||||||
if (i==1000)
|
if (timeout==1000)
|
||||||
{
|
{
|
||||||
LOG_ERROR("write timed out");
|
LOG_ERROR("write timed out");
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
|
Loading…
Reference in New Issue