mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-15 21:30:05 +00:00
Rework to make use of declared memory map regions.
This commit is contained in:
@@ -21,4 +21,13 @@
|
||||
|
||||
#include "portapack_shared_memory.hpp"
|
||||
|
||||
SharedMemory& shared_memory = *reinterpret_cast<SharedMemory*>(0x10088000);
|
||||
#include "memory_map.hpp"
|
||||
|
||||
SharedMemory& shared_memory = *reinterpret_cast<SharedMemory*>(
|
||||
portapack::memory::map::shared_memory.base()
|
||||
);
|
||||
|
||||
static_assert(
|
||||
sizeof(SharedMemory) <= portapack::memory::map::shared_memory.size(),
|
||||
"SharedMemory is too large"
|
||||
);
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
#include "hal.h"
|
||||
#include "memory_map.hpp"
|
||||
|
||||
namespace portapack {
|
||||
namespace spi_flash {
|
||||
@@ -34,8 +34,8 @@ struct region_t {
|
||||
const size_t offset;
|
||||
const size_t size;
|
||||
|
||||
constexpr const void* base_address() {
|
||||
return reinterpret_cast<void*>(LPC_SPIFI_DATA_CACHED_BASE + offset);
|
||||
constexpr const void* base() {
|
||||
return reinterpret_cast<void*>(portapack::memory::map::spifi_cached.base() + offset);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user