mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 22:57:50 +03:00
fix max alloc
This commit is contained in:
parent
7c49fc93e8
commit
1d2fff18d5
@ -1,5 +1,3 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "ResourcesFS.h"
|
#include "ResourcesFS.h"
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
@ -35,7 +33,6 @@ bool ResourcesFS::begin(bool remount) {
|
|||||||
spi_flash_mmap_handle_t map_handle; // unused
|
spi_flash_mmap_handle_t map_handle; // unused
|
||||||
size_t len = impl->partition->size;
|
size_t len = impl->partition->size;
|
||||||
if (len > MAX_ALLOC_SIZE) {
|
if (len > MAX_ALLOC_SIZE) {
|
||||||
// FIXME: cannot mmap too large region at once, why?
|
|
||||||
len = MAX_ALLOC_SIZE;
|
len = MAX_ALLOC_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,9 +11,12 @@ class ResourcesFS {
|
|||||||
ResourcesFS() = default;
|
ResourcesFS() = default;
|
||||||
~ResourcesFS() = default;
|
~ResourcesFS() = default;
|
||||||
|
|
||||||
|
// FIXME: true MAX_ALLOC_SIZE = ~3.5MB but not enough pages to do mmap
|
||||||
|
// See: spi_flash_mmap_get_free_pages() --> ~31 free pages on real device
|
||||||
|
|
||||||
static constexpr size_t MAX_FILES = 32;
|
static constexpr size_t MAX_FILES = 32;
|
||||||
static constexpr size_t MAX_FILE_NAME_LENGTH = 32;
|
static constexpr size_t MAX_FILE_NAME_LENGTH = 32;
|
||||||
static constexpr size_t MAX_ALLOC_SIZE = 3 * 1024 * 1024; // 3 MB
|
static constexpr size_t MAX_ALLOC_SIZE = 28 * 64 * 1024; // 28 pages == ~1.8 MB
|
||||||
static constexpr size_t ALIGNMENT = 4; // bytes
|
static constexpr size_t ALIGNMENT = 4; // bytes
|
||||||
static constexpr uint32_t MAGIC = 0x46535631; // "FSV1"
|
static constexpr uint32_t MAGIC = 0x46535631; // "FSV1"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user