edit userflash, not used yet
This commit is contained in:
@ -40,7 +40,7 @@
|
|||||||
#include "MAIN_MainApplication.h"
|
#include "MAIN_MainApplication.h"
|
||||||
|
|
||||||
// Drivers
|
// Drivers
|
||||||
#include "../Drivers/USFL_UserFlash.h"
|
//#include "../Drivers/USFL_UserFlash.h"
|
||||||
#include "../Drivers/ANPI_AnalogPortsIn.h"
|
#include "../Drivers/ANPI_AnalogPortsIn.h"
|
||||||
#include "../Drivers/ANPO_AnalogPortsOut.h"
|
#include "../Drivers/ANPO_AnalogPortsOut.h"
|
||||||
#include "../Drivers/SPID_SpiDriver.h"
|
#include "../Drivers/SPID_SpiDriver.h"
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
FLASH_EraseInitTypeDef stEreaseInit = {
|
FLASH_EraseInitTypeDef stEreaseInit = {
|
||||||
FLASH_TYPEERASE_PAGES,
|
FLASH_TYPEERASE_PAGES,
|
||||||
FLASH_BANK_1,
|
FLASH_BANK_1,
|
||||||
UserFlashPage,
|
USERFLASHPAGE,
|
||||||
1
|
1
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -107,14 +107,14 @@ FLASH_EraseInitTypeDef stEreaseInit = {
|
|||||||
// Description: Definition of local constants (visible by this module only).
|
// 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)
|
// Section: LOCAL FUNCTIONS (PROTOTYPES)
|
||||||
// Description: Definition of local functions (visible by this module only).
|
// Description: Definition of local functions (visible by this module only).
|
||||||
//=================================================================================================
|
//=================================================================================================
|
||||||
|
|
||||||
void vEreaseUserFlash( void );
|
BOOL vEreaseUserFlash( void );
|
||||||
|
|
||||||
//=================================================================================================
|
//=================================================================================================
|
||||||
// Section: GLOBAL FUNCTIONS
|
// Section: GLOBAL FUNCTIONS
|
||||||
@ -132,7 +132,7 @@ BOOL USFL_boInitializeModule( VOID )
|
|||||||
{
|
{
|
||||||
BOOL boOK = TRUE;
|
BOOL boOK = TRUE;
|
||||||
|
|
||||||
if( UserFlash[0] != StartDef ){
|
if( UserFlash[0] != STARTDEF ){
|
||||||
boOK &= vEreaseUserFlash();
|
boOK &= vEreaseUserFlash();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,10 +190,10 @@ BOOL vEreaseUserFlash( void ){
|
|||||||
uint32_t u32PageError = 0;
|
uint32_t u32PageError = 0;
|
||||||
|
|
||||||
if( HAL_FLASHEx_Erase(&stEreaseInit, &u32PageError) != HAL_OK ){
|
if( HAL_FLASHEx_Erase(&stEreaseInit, &u32PageError) != HAL_OK ){
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user