Fixed formatting F4
This commit is contained in:
Nima Askari (نیما عسکری) 2024-06-16 14:26:15 +02:00
parent 810dd7c944
commit 165c6bb7e2
2 changed files with 11 additions and 2 deletions

8
ee.c
View File

@ -38,6 +38,7 @@
#define EE_ERASE EE_ERASE_SECTOR_NUMBER
#define EE_SIZE 0x20000
#define FLASH_SIZE ((((uint32_t)(*((uint16_t *)FLASHSIZE_BASE)) & (0xFFFFU))) * 1024)
#define FLASH_F4_OFFSET 4
#endif
#ifdef STM32F7
@ -128,6 +129,7 @@
#endif
#endif
#ifndef EE_ADDRESS
#if (EE_BANK_SELECT != FLASH_BANK_2)
#define EE_ADDRESS (FLASH_BASE + EE_SIZE * EE_PAGE_SECTOR)
@ -136,6 +138,10 @@
#endif
#endif
#ifndef FLASH_F4_OFFSET
#define FLASH_F4_OFFSET 0
#endif
#ifndef EE_ERASE
#error "Not Supported MCU!"
#endif
@ -228,7 +234,7 @@ bool EE_Format(void)
flashErase.NbPages = 1;
#else
flashErase.TypeErase = FLASH_TYPEERASE_SECTORS;
flashErase.Sector = EE_PAGE_SECTOR;
flashErase.Sector = EE_PAGE_SECTOR + FLASH_F4_OFFSET;
flashErase.NbSectors = 1;
#endif
#ifdef EE_BANK_SELECT

5
ee.h
View File

@ -9,9 +9,12 @@
Youtube: https://www.youtube.com/@nimaltd
Instagram: https://instagram.com/github.NimaLTD
Version: 3.1.0
Version: 3.1.1
History:
3.1.1
- Fixed formating F4
3.1.0
- Added Verify after Writing
- Added Checking Pointer in Reading/Writing