edit userflash, not used yet
This commit is contained in:
@ -90,7 +90,7 @@
|
||||
FLASH_EraseInitTypeDef stEreaseInit = {
|
||||
FLASH_TYPEERASE_PAGES,
|
||||
FLASH_BANK_1,
|
||||
UserFlashPage,
|
||||
USERFLASHPAGE,
|
||||
1
|
||||
};
|
||||
|
||||
@ -107,14 +107,14 @@ FLASH_EraseInitTypeDef stEreaseInit = {
|
||||
// Description: Definition of local constants (visible by this module only).
|
||||
//=================================================================================================
|
||||
|
||||
__attribute__((__section__(".user_data"))) const U64 UserFlash[UserFlashSize];
|
||||
__attribute__((__section__(".user_data"))) const U64 UserFlash[USERFLASHSIZE];
|
||||
|
||||
//=================================================================================================
|
||||
// Section: LOCAL FUNCTIONS (PROTOTYPES)
|
||||
// Description: Definition of local functions (visible by this module only).
|
||||
//=================================================================================================
|
||||
|
||||
void vEreaseUserFlash( void );
|
||||
BOOL vEreaseUserFlash( void );
|
||||
|
||||
//=================================================================================================
|
||||
// Section: GLOBAL FUNCTIONS
|
||||
@ -132,7 +132,7 @@ BOOL USFL_boInitializeModule( VOID )
|
||||
{
|
||||
BOOL boOK = TRUE;
|
||||
|
||||
if( UserFlash[0] != StartDef ){
|
||||
if( UserFlash[0] != STARTDEF ){
|
||||
boOK &= vEreaseUserFlash();
|
||||
}
|
||||
|
||||
@ -190,10 +190,10 @@ BOOL vEreaseUserFlash( void ){
|
||||
uint32_t u32PageError = 0;
|
||||
|
||||
if( HAL_FLASHEx_Erase(&stEreaseInit, &u32PageError) != HAL_OK ){
|
||||
return false;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user