Flash size is obtained dynamically rather than in build time. It will allow to reduce dramatically the number of builds.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2025-05-30 12:06:26 +02:00
parent da3a7f25d0
commit f01aca5518
2 changed files with 23 additions and 17 deletions

View File

@@ -23,11 +23,12 @@
#define XIP_BASE 0
#define FLASH_SECTOR_SIZE 4096
#ifdef ESP_PLATFORM
uint32_t PICO_FLASH_SIZE_BYTES = (1 * 1024 * 1024);
uint32_t FLASH_SIZE_BYTES = (1 * 1024 * 1024);
#else
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#define FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
#else
uint32_t FLASH_SIZE_BYTES = (2 * 1024 * 1024);
#include "pico/stdlib.h"
#include "hardware/flash.h"
#endif
@@ -210,5 +211,5 @@ uint32_t flash_num_files() {
}
uint32_t flash_size() {
return PICO_FLASH_SIZE_BYTES;
return FLASH_SIZE_BYTES;
}