Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
Diff: targets/TARGET_Silicon_Labs/TARGET_EFM32/flash_api.c
- Revision:
- 179:b0033dcd6934
- Parent:
- 167:e84263d55307
diff -r 79309dc6340a -r b0033dcd6934 targets/TARGET_Silicon_Labs/TARGET_EFM32/flash_api.c
--- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/flash_api.c Thu Nov 23 11:57:25 2017 +0000
+++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/flash_api.c Thu Dec 07 14:01:42 2017 +0000
@@ -93,10 +93,17 @@
(void)obj;
(void)address;
+#if FLASH_BASE > 0
if (address < FLASH_BASE || address >= FLASH_BASE + FLASH_SIZE) {
// Address outside of flash -- invalid sector
return MBED_FLASH_INVALID_SIZE;
}
+#else
+ if (address >= FLASH_BASE + FLASH_SIZE) {
+ // Address outside of flash -- invalid sector
+ return MBED_FLASH_INVALID_SIZE;
+ }
+#endif
return FLASH_PAGE_SIZE;
}
