Pico flash size bytes (#159)

* Move PICO_FLASH_SIZE_BYTES out of platform_defs.h since it precedes board config; also default to -1 for unknown

* make default for PICO_FLASH_SIZE_BYTES undefined - i.e. no value
This commit is contained in:
Graham Sanderson 2021-02-25 11:01:01 -06:00 committed by graham sanderson
parent 0d789c9b54
commit 743dbabdec
2 changed files with 16 additions and 15 deletions

View File

@ -46,9 +46,5 @@
#endif
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
#endif

View File

@ -9,17 +9,6 @@
#include "pico.h"
// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_FLASH, Enable/disable assertions in the flash module, type=bool, default=0, group=hardware_flash
#ifndef PARAM_ASSERTIONS_ENABLED_FLASH
#define PARAM_ASSERTIONS_ENABLED_FLASH 0
#endif
#define FLASH_PAGE_SIZE (1u << 8)
#define FLASH_SECTOR_SIZE (1u << 12)
#define FLASH_BLOCK_SIZE (1u << 16)
#define FLASH_UNIQUE_ID_SIZE_BYTES 8
/** \file flash.h
* \defgroup hardware_flash hardware_flash
*
@ -44,6 +33,22 @@
* \include flash_program.c
*/
// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_FLASH, Enable/disable assertions in the flash module, type=bool, default=0, group=hardware_flash
#ifndef PARAM_ASSERTIONS_ENABLED_FLASH
#define PARAM_ASSERTIONS_ENABLED_FLASH 0
#endif
#define FLASH_PAGE_SIZE (1u << 8)
#define FLASH_SECTOR_SIZE (1u << 12)
#define FLASH_BLOCK_SIZE (1u << 16)
#define FLASH_UNIQUE_ID_SIZE_BYTES 8
// PICO_CONFIG: PICO_FLASH_SIZE_BYTES, size of primary flash in bytes, type=int, default=-1, group=hardware_flash
#ifndef PICO_FLASH_SIZE_BYTES
#warning PICO_FLASH_SIZE_BYTES is not set
#endif
#ifdef __cplusplus
extern "C" {
#endif