From b6489425c631bf4d6551c352dc17836923c9157b Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Thu, 11 Mar 2021 10:31:03 +0000 Subject: [PATCH] rp2/rp2_flash: Prevent MICROPY_HW_FLASH_STORAGE_BASE being set negative. --- ports/rp2/rp2_flash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/rp2/rp2_flash.c b/ports/rp2/rp2_flash.c index cd1bc65489df..b89cb6fd8919 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 {