Skip to content

Commit

Permalink
rp2/rp2_flash: Prevent MICROPY_HW_FLASH_STORAGE_BASE being set negative.
Browse files Browse the repository at this point in the history
  • Loading branch information
lurch authored and dpgeorge committed Mar 11, 2021
1 parent c675452 commit b648942
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ports/rp2/rp2_flash.c
Expand Up @@ -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 {
Expand Down

0 comments on commit b648942

Please sign in to comment.