@@ -145,7 +145,6 @@ int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data,
145
145
146
146
uint32_t flash_get_sector_size (const flash_t * obj , uint32_t address )
147
147
{
148
-
149
148
if ((address >= (FLASH_BASE + FLASH_SIZE )) || (address < FLASH_BASE )) {
150
149
return MBED_FLASH_INVALID_SIZE ;
151
150
}
@@ -165,7 +164,7 @@ uint32_t flash_get_start_address(const flash_t *obj)
165
164
}
166
165
uint32_t flash_get_size (const flash_t * obj )
167
166
{
168
- return FLASH_SIZE ;
167
+ return FLASH_SIZE ;
169
168
}
170
169
171
170
/**
@@ -175,7 +174,7 @@ uint32_t flash_get_size(const flash_t *obj)
175
174
*/
176
175
static uint32_t GetSector (uint32_t address )
177
176
{
178
- uint32_t sector = 0 ;
177
+ uint32_t sector = 0 ;
179
178
uint32_t tmp = address - ADDR_FLASH_SECTOR_0 ;
180
179
/* This function supports 1Mb and 2Mb flash sizes */
181
180
#if defined(ADDR_FLASH_SECTOR_16 )
@@ -191,14 +190,14 @@ static uint32_t GetSector(uint32_t address)
191
190
}
192
191
#if defined(ADDR_FLASH_SECTOR_5 )
193
192
else if (address < ADDR_FLASH_SECTOR_5 ) { //64k sector size
194
- sector += FLASH_SECTOR_4 ;
193
+ sector += FLASH_SECTOR_4 ;
195
194
} else {
196
195
sector += 4 + (tmp >>17 );
197
196
}
198
197
#else
199
198
// In case ADDR_FLASH_SECTOR_5 is not defined, sector 4 is the last one.
200
199
else { //64k sector size
201
- sector += FLASH_SECTOR_4 ;
200
+ sector += FLASH_SECTOR_4 ;
202
201
}
203
202
#endif
204
203
return sector ;
@@ -227,7 +226,7 @@ if((Sector == FLASH_SECTOR_0) || (Sector == FLASH_SECTOR_1) || (Sector == FLASH_
227
226
sectorsize = 64 * 1024 ;
228
227
} else {
229
228
sectorsize = 128 * 1024 ;
230
- }
229
+ }
231
230
return sectorsize ;
232
231
}
233
232
0 commit comments