stm32: f247: flash: use common code.
This shows what is _actually_ different for f7. A couple of option bits, and a renaming of bit 7 of the status register, from Program Sequence Error to Erase Sequence Error. We keep the separate implementation of wait_for_last_operation, to meet the "suggestions" of the reference manual to insert a DSB instruction. Keeping the renamed bit/functions also requires us to keep separate implementations of the flag clearing functions
This commit is contained in:
@@ -41,17 +41,6 @@ static inline void flash_set_program_size(uint32_t psize)
|
||||
FLASH_CR |= psize << FLASH_CR_PROGRAM_SHIFT;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief Clear the Programming Sequence Error Flag
|
||||
|
||||
This flag is set when incorrect programming configuration has been made.
|
||||
*/
|
||||
|
||||
void flash_clear_pgserr_flag(void)
|
||||
{
|
||||
FLASH_SR |= FLASH_SR_PGSERR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief Clear the Programming Alignment Error Flag
|
||||
|
||||
@@ -79,21 +68,6 @@ void flash_clear_wrperr_flag(void)
|
||||
FLASH_SR |= FLASH_SR_WRPERR;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief Clear All Status Flags
|
||||
|
||||
Program error, end of operation, write protect error, busy.
|
||||
*/
|
||||
|
||||
void flash_clear_status_flags(void)
|
||||
{
|
||||
flash_clear_pgserr_flag();
|
||||
flash_clear_pgaerr_flag();
|
||||
flash_clear_wrperr_flag();
|
||||
flash_clear_pgperr_flag();
|
||||
flash_clear_eop_flag();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @brief Lock the Option Byte Access
|
||||
|
||||
|
||||
Reference in New Issue
Block a user