Skip to content

Commit c5d76a2

Browse files
committed
Correct comments in flash api for STM32 L0 targets
The initial comments were copied from L4 implementation but do not apply to L0 targets where 1 sector is composed of a constant number of pages.
1 parent e3e54e5 commit c5d76a2

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)