/* Waits for a Flash operation on Bank1 to complete or a TIMEOUT to occur.  */
FLASH_Status FLASH_WaitForLastBank1Operation(uint32_t Timeout)
/* Waits for a Flash operation on Bank1 to complete or a TIMEOUT to occur.  */
FLASH_Status FLASH_WaitForLastBank1Operation(uint32_t Timeout)
{ 
  FLASH_Status status = FLASH_COMPLETE;
  status = FLASH_GetBank1Status();
  while((status == FLASH_FLAG_BANK1_BSY) && (Timeout != 0x00))
  {
    status = FLASH_GetBank1Status();
    Timeout--;
  }
  if(Timeout == 0x00 )
  {
    status = FLASH_TIMEOUT;
  }
  return status;
}