#define KEY1 0x45670123
#define KEY2 0xCDEF89AB
+/* timeout values */
+
+#define FLASH_WRITE_TIMEOUT 10
+#define FLASH_ERASE_TIMEOUT 100
+
struct stm32x_options {
uint16_t RDP;
uint16_t user_options;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 10);
+ retval = stm32x_wait_status_busy(bank, FLASH_ERASE_TIMEOUT);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 10);
+ retval = stm32x_wait_status_busy(bank, FLASH_WRITE_TIMEOUT);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 10);
+ retval = stm32x_wait_status_busy(bank, FLASH_WRITE_TIMEOUT);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 10);
+ retval = stm32x_wait_status_busy(bank, FLASH_WRITE_TIMEOUT);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 10);
+ retval = stm32x_wait_status_busy(bank, FLASH_WRITE_TIMEOUT);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 10);
+ retval = stm32x_wait_status_busy(bank, FLASH_WRITE_TIMEOUT);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 10);
+ retval = stm32x_wait_status_busy(bank, FLASH_WRITE_TIMEOUT);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 100);
+ retval = stm32x_wait_status_busy(bank, FLASH_ERASE_TIMEOUT);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- retval = stm32x_wait_status_busy(bank, 100);
+ retval = stm32x_wait_status_busy(bank, FLASH_ERASE_TIMEOUT);
if (retval != ERROR_OK)
return retval;