return retval;
}
- int i;
- for (i=0; i<1000; i++) {
+ int timeout;
+ for (timeout=0; timeout<1000; timeout++) {
if ((retval=target_read_u8(target, adr, &status))!=ERROR_OK)
{
return retval;
break;
alive_sleep(1);
}
- if (i==1000)
+ if (timeout==1000)
{
LOG_ERROR("erase timed out");
return ERROR_FAIL;
/* get status command */
target_write_u16(target, bank_adr, 0x70);
- int i;
- for (i=0; i<1000; i++)
+ int timeout;
+ for (timeout=0; timeout<1000; timeout++)
{
target_read_u8(target, bank_adr, &status);
if( status & 0x80 )
break;
alive_sleep(1);
}
- if (i==1000)
+ if (timeout==1000)
{
LOG_ERROR("write timed out");
return ERROR_FAIL;
/* query status command */
target_write_u16(target, bank_adr, 0x70);
- int i;
- for (i=0; i<1000; i++)
+ int timeout;
+ for (timeout=0; timeout<1000; timeout++)
{
target_read_u8(target, bank_adr, &status);
if( status & 0x80 )
break;
alive_sleep(1);
}
- if (i==1000)
+ if (timeout==1000)
{
LOG_ERROR("write timed out");
return ERROR_FAIL;