/* Erase All FLASH. 
This performs all operations necessary to erase all sectors in the FLASH memory. */
void flash_erase_all_sectors(uint32_t program_size)
/* Erase All FLASH. 
This performs all operations necessary to erase all sectors in the FLASH memory. */
void flash_erase_all_sectors(uint32_t program_size)
{
	flash_wait_for_last_operation();
	flash_set_program_size(program_size);
	FLASH_CR |= FLASH_CR_MER;
	FLASH_CR |= FLASH_CR_STRT;
	flash_wait_for_last_operation();
	FLASH_CR &= ~FLASH_CR_MER;
}