[Style] Stylefix sweep over the whole codebase.
This commit is contained in:
@@ -128,8 +128,9 @@ void flash_lock_upper(void)
|
||||
|
||||
void flash_clear_pgerr_flag_upper(void)
|
||||
{
|
||||
if (MEMORY_SIZE_REG > 512)
|
||||
if (MEMORY_SIZE_REG > 512) {
|
||||
FLASH_SR2 |= FLASH_SR_PGERR;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@@ -139,8 +140,9 @@ void flash_clear_pgerr_flag_upper(void)
|
||||
|
||||
void flash_clear_eop_flag_upper(void)
|
||||
{
|
||||
if (MEMORY_SIZE_REG > 512)
|
||||
if (MEMORY_SIZE_REG > 512) {
|
||||
FLASH_SR2 |= FLASH_SR_EOP;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@@ -150,8 +152,9 @@ void flash_clear_eop_flag_upper(void)
|
||||
|
||||
void flash_clear_wrprterr_flag_upper(void)
|
||||
{
|
||||
if (MEMORY_SIZE_REG > 512)
|
||||
if (MEMORY_SIZE_REG > 512) {
|
||||
FLASH_SR2 |= FLASH_SR_WRPRTERR;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@@ -161,8 +164,9 @@ void flash_clear_wrprterr_flag_upper(void)
|
||||
|
||||
void flash_clear_bsy_flag_upper(void)
|
||||
{
|
||||
if (MEMORY_SIZE_REG > 512)
|
||||
if (MEMORY_SIZE_REG > 512) {
|
||||
FLASH_SR2 &= ~FLASH_SR_BSY;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@@ -204,12 +208,14 @@ uint32_t flash_get_status_flags(void)
|
||||
FLASH_SR_EOP |
|
||||
FLASH_SR_WRPRTERR |
|
||||
FLASH_SR_BSY));
|
||||
if (MEMORY_SIZE_REG > 512)
|
||||
if (MEMORY_SIZE_REG > 512) {
|
||||
flags |= (FLASH_SR2 & (FLASH_SR_PGERR |
|
||||
FLASH_SR_EOP |
|
||||
FLASH_SR_WRPRTERR |
|
||||
FLASH_SR_BSY));
|
||||
return flags;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@@ -229,17 +235,21 @@ void flash_program_half_word(uint32_t address, uint16_t data)
|
||||
{
|
||||
flash_wait_for_last_operation();
|
||||
|
||||
if ((MEMORY_SIZE_REG > 512) && (address >= FLASH_BASE+0x00080000))
|
||||
if ((MEMORY_SIZE_REG > 512) && (address >= FLASH_BASE+0x00080000)) {
|
||||
FLASH_CR2 |= FLASH_CR_PG;
|
||||
else FLASH_CR |= FLASH_CR_PG;
|
||||
} else {
|
||||
FLASH_CR |= FLASH_CR_PG;
|
||||
}
|
||||
|
||||
MMIO16(address) = data;
|
||||
|
||||
flash_wait_for_last_operation();
|
||||
|
||||
if ((MEMORY_SIZE_REG > 512) && (address >= FLASH_BASE+0x00080000))
|
||||
if ((MEMORY_SIZE_REG > 512) && (address >= FLASH_BASE+0x00080000)) {
|
||||
FLASH_CR2 &= ~FLASH_CR_PG;
|
||||
else FLASH_CR &= ~FLASH_CR_PG;
|
||||
} else {
|
||||
FLASH_CR &= ~FLASH_CR_PG;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
@@ -259,7 +269,8 @@ void flash_erase_page(uint32_t page_address)
|
||||
{
|
||||
flash_wait_for_last_operation();
|
||||
|
||||
if ((MEMORY_SIZE_REG > 512) && (page_address >= FLASH_BASE+0x00080000)) {
|
||||
if ((MEMORY_SIZE_REG > 512)
|
||||
&& (page_address >= FLASH_BASE+0x00080000)) {
|
||||
FLASH_CR2 |= FLASH_CR_PER;
|
||||
FLASH_AR2 = page_address;
|
||||
FLASH_CR2 |= FLASH_CR_STRT;
|
||||
@@ -271,10 +282,12 @@ void flash_erase_page(uint32_t page_address)
|
||||
|
||||
flash_wait_for_last_operation();
|
||||
|
||||
if ((MEMORY_SIZE_REG > 512) && (page_address >= FLASH_BASE+0x00080000))
|
||||
if ((MEMORY_SIZE_REG > 512)
|
||||
&& (page_address >= FLASH_BASE+0x00080000)) {
|
||||
FLASH_CR2 &= ~FLASH_CR_PER;
|
||||
else
|
||||
} else {
|
||||
FLASH_CR &= ~FLASH_CR_PER;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user