From 2d99902346b84e9e7df8277c81719eaca870e717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noah=20Piqu=C3=A9?= Date: Fri, 10 Jun 2022 15:44:37 +0200 Subject: [PATCH] edit userflash, not used yet --- Core/Application/INIT_Initialization.c | 2 +- Core/Drivers/USFL_UserFlash.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/Application/INIT_Initialization.c b/Core/Application/INIT_Initialization.c index 5a65361..3814edc 100644 --- a/Core/Application/INIT_Initialization.c +++ b/Core/Application/INIT_Initialization.c @@ -40,7 +40,7 @@ #include "MAIN_MainApplication.h" // Drivers -#include "../Drivers/USFL_UserFlash.h" +//#include "../Drivers/USFL_UserFlash.h" #include "../Drivers/ANPI_AnalogPortsIn.h" #include "../Drivers/ANPO_AnalogPortsOut.h" #include "../Drivers/SPID_SpiDriver.h" diff --git a/Core/Drivers/USFL_UserFlash.c b/Core/Drivers/USFL_UserFlash.c index 6c9b17d..239e0cc 100644 --- a/Core/Drivers/USFL_UserFlash.c +++ b/Core/Drivers/USFL_UserFlash.c @@ -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; }