mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-30 06:40:25 +08:00
add space
This commit is contained in:
parent
6b614c05b8
commit
8f5e1c5715
@ -52,49 +52,49 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
|
|||||||
HAL_FLASHEx_OBGetConfig(&OBInit);
|
HAL_FLASHEx_OBGetConfig(&OBInit);
|
||||||
nbank = ((OBInit.USERConfig & 0x20000000U) >> 29);
|
nbank = ((OBInit.USERConfig & 0x20000000U) >> 29);
|
||||||
//1:single bank mode
|
//1:single bank mode
|
||||||
if(1 == nbank)
|
if (1 == nbank)
|
||||||
{
|
{
|
||||||
if((Address < ADDR_FLASH_SECTOR_1) && (Address >= ADDR_FLASH_SECTOR_0))
|
if ((Address < ADDR_FLASH_SECTOR_1) && (Address >= ADDR_FLASH_SECTOR_0))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_0;
|
sector = FLASH_SECTOR_0;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_2) && (Address >= ADDR_FLASH_SECTOR_1))
|
else if ((Address < ADDR_FLASH_SECTOR_2) && (Address >= ADDR_FLASH_SECTOR_1))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_1;
|
sector = FLASH_SECTOR_1;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_3) && (Address >= ADDR_FLASH_SECTOR_2))
|
else if ((Address < ADDR_FLASH_SECTOR_3) && (Address >= ADDR_FLASH_SECTOR_2))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_2;
|
sector = FLASH_SECTOR_2;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_4) && (Address >= ADDR_FLASH_SECTOR_3))
|
else if ((Address < ADDR_FLASH_SECTOR_4) && (Address >= ADDR_FLASH_SECTOR_3))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_3;
|
sector = FLASH_SECTOR_3;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_5) && (Address >= ADDR_FLASH_SECTOR_4))
|
else if ((Address < ADDR_FLASH_SECTOR_5) && (Address >= ADDR_FLASH_SECTOR_4))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_4;
|
sector = FLASH_SECTOR_4;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_6) && (Address >= ADDR_FLASH_SECTOR_5))
|
else if ((Address < ADDR_FLASH_SECTOR_6) && (Address >= ADDR_FLASH_SECTOR_5))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_5;
|
sector = FLASH_SECTOR_5;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_7) && (Address >= ADDR_FLASH_SECTOR_6))
|
else if ((Address < ADDR_FLASH_SECTOR_7) && (Address >= ADDR_FLASH_SECTOR_6))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_6;
|
sector = FLASH_SECTOR_6;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_8) && (Address >= ADDR_FLASH_SECTOR_7))
|
else if ((Address < ADDR_FLASH_SECTOR_8) && (Address >= ADDR_FLASH_SECTOR_7))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_7;
|
sector = FLASH_SECTOR_7;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_9) && (Address >= ADDR_FLASH_SECTOR_8))
|
else if ((Address < ADDR_FLASH_SECTOR_9) && (Address >= ADDR_FLASH_SECTOR_8))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_8;
|
sector = FLASH_SECTOR_8;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_10) && (Address >= ADDR_FLASH_SECTOR_9))
|
else if ((Address < ADDR_FLASH_SECTOR_10) && (Address >= ADDR_FLASH_SECTOR_9))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_9;
|
sector = FLASH_SECTOR_9;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_11) && (Address >= ADDR_FLASH_SECTOR_10))
|
else if ((Address < ADDR_FLASH_SECTOR_11) && (Address >= ADDR_FLASH_SECTOR_10))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_10;
|
sector = FLASH_SECTOR_10;
|
||||||
}
|
}
|
||||||
@ -108,47 +108,47 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
|
|||||||
RT_ASSERT("rtthread doesn't support duel bank mode yet!");
|
RT_ASSERT("rtthread doesn't support duel bank mode yet!");
|
||||||
}
|
}
|
||||||
#else //no dual bank ability
|
#else //no dual bank ability
|
||||||
if((Address < ADDR_FLASH_SECTOR_1) && (Address >= ADDR_FLASH_SECTOR_0))
|
if ((Address < ADDR_FLASH_SECTOR_1) && (Address >= ADDR_FLASH_SECTOR_0))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_0;
|
sector = FLASH_SECTOR_0;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_2) && (Address >= ADDR_FLASH_SECTOR_1))
|
else if ((Address < ADDR_FLASH_SECTOR_2) && (Address >= ADDR_FLASH_SECTOR_1))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_1;
|
sector = FLASH_SECTOR_1;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_3) && (Address >= ADDR_FLASH_SECTOR_2))
|
else if ((Address < ADDR_FLASH_SECTOR_3) && (Address >= ADDR_FLASH_SECTOR_2))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_2;
|
sector = FLASH_SECTOR_2;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_4) && (Address >= ADDR_FLASH_SECTOR_3))
|
else if ((Address < ADDR_FLASH_SECTOR_4) && (Address >= ADDR_FLASH_SECTOR_3))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_3;
|
sector = FLASH_SECTOR_3;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_5) && (Address >= ADDR_FLASH_SECTOR_4))
|
else if ((Address < ADDR_FLASH_SECTOR_5) && (Address >= ADDR_FLASH_SECTOR_4))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_4;
|
sector = FLASH_SECTOR_4;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_6) && (Address >= ADDR_FLASH_SECTOR_5))
|
else if ((Address < ADDR_FLASH_SECTOR_6) && (Address >= ADDR_FLASH_SECTOR_5))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_5;
|
sector = FLASH_SECTOR_5;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_7) && (Address >= ADDR_FLASH_SECTOR_6))
|
else if ((Address < ADDR_FLASH_SECTOR_7) && (Address >= ADDR_FLASH_SECTOR_6))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_6;
|
sector = FLASH_SECTOR_6;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_8) && (Address >= ADDR_FLASH_SECTOR_7))
|
else if ((Address < ADDR_FLASH_SECTOR_8) && (Address >= ADDR_FLASH_SECTOR_7))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_7;
|
sector = FLASH_SECTOR_7;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_9) && (Address >= ADDR_FLASH_SECTOR_8))
|
else if ((Address < ADDR_FLASH_SECTOR_9) && (Address >= ADDR_FLASH_SECTOR_8))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_8;
|
sector = FLASH_SECTOR_8;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_10) && (Address >= ADDR_FLASH_SECTOR_9))
|
else if ((Address < ADDR_FLASH_SECTOR_10) && (Address >= ADDR_FLASH_SECTOR_9))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_9;
|
sector = FLASH_SECTOR_9;
|
||||||
}
|
}
|
||||||
else if((Address < ADDR_FLASH_SECTOR_11) && (Address >= ADDR_FLASH_SECTOR_10))
|
else if ((Address < ADDR_FLASH_SECTOR_11) && (Address >= ADDR_FLASH_SECTOR_10))
|
||||||
{
|
{
|
||||||
sector = FLASH_SECTOR_10;
|
sector = FLASH_SECTOR_10;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user