diff options
author | Andrew Scheller <github@loowis.durge.org> | 2021-03-11 10:31:03 +0000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-03-12 00:57:29 +1100 |
commit | b6489425c631bf4d6551c352dc17836923c9157b (patch) | |
tree | 5336fd2e6db76447078f93a43473e65fec51a751 | |
parent | c675452566ffcae1a49121b84a0233ed164b2152 (diff) |
rp2/rp2_flash: Prevent MICROPY_HW_FLASH_STORAGE_BASE being set negative.
-rw-r--r-- | ports/rp2/rp2_flash.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/rp2/rp2_flash.c b/ports/rp2/rp2_flash.c index cd1bc6548..b89cb6fd8 100644 --- a/ports/rp2/rp2_flash.c +++ b/ports/rp2/rp2_flash.c @@ -42,6 +42,7 @@ #define MICROPY_HW_FLASH_STORAGE_BASE (PICO_FLASH_SIZE_BYTES - MICROPY_HW_FLASH_STORAGE_BYTES) #endif +static_assert(MICROPY_HW_FLASH_STORAGE_BYTES <= PICO_FLASH_SIZE_BYTES, "MICROPY_HW_FLASH_STORAGE_BYTES too big"); static_assert(MICROPY_HW_FLASH_STORAGE_BASE + MICROPY_HW_FLASH_STORAGE_BYTES <= PICO_FLASH_SIZE_BYTES, "MICROPY_HW_FLASH_STORAGE_BYTES too big"); typedef struct _rp2_flash_obj_t { |