/* Read All Status Flags. 
Flags for the upper bank, where appropriate, are combined with those for the lower bank using bitwise OR, without distinction. */
uint32_t flash_get_status_flags(void)
/* Read All Status Flags. 
Flags for the upper bank, where appropriate, are combined with those for the lower bank using bitwise OR, without distinction. */
uint32_t flash_get_status_flags(void)
{
	uint32_t flags = (FLASH_SR & (FLASH_SR_PGERR |
			FLASH_SR_EOP |
			FLASH_SR_WRPRTERR |
			FLASH_SR_BSY));
	if (DESIG_FLASH_SIZE > 512) {
		flags |= (FLASH_SR2 & (FLASH_SR_PGERR |
			FLASH_SR_EOP |
			FLASH_SR_WRPRTERR |
			FLASH_SR_BSY));
	}
	return flags;
}