Skip to content

Commit 9b082ff

Browse files
Merge pull request #4656 from LMESTM/update_flash_comments
Correct comments in flash api for STM32 L0 targets
2 parents 0c5fc5b + c5d76a2 commit 9b082ff

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

targets/TARGET_STM/TARGET_STM32L0/flash_api.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,15 @@ int32_t flash_program_page(flash_t *obj, uint32_t address,
119119
}
120120

121121
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address) {
122-
/* considering 1 sector = 1 page */
123122
if ((address >= (FLASH_BASE + FLASH_SIZE)) || (address < FLASH_BASE)) {
124123
return MBED_FLASH_INVALID_SIZE;
125124
} else {
125+
/* sector composed of N pages */
126126
return (NUM_PAGES_IN_SECTOR * FLASH_PAGE_SIZE);
127127
}
128128
}
129129

130130
uint32_t flash_get_page_size(const flash_t *obj) {
131-
/* considering 1 sector = 1 page */
132131
return FLASH_PAGE_SIZE;
133132
}
134133

0 commit comments

Comments
 (0)