diff --git a/firmware/common/memory_map.hpp b/firmware/common/memory_map.hpp index 3a1155bd..6f4eae1e 100644 --- a/firmware/common/memory_map.hpp +++ b/firmware/common/memory_map.hpp @@ -28,6 +28,8 @@ #include "lpc43xx_cpp.hpp" using namespace lpc43xx; +#include "utility.hpp" + namespace portapack { namespace memory { @@ -58,14 +60,6 @@ private: const size_t size_; }; -constexpr size_t operator "" _KiB(unsigned long long v) { - return v * 1024; -} - -constexpr size_t operator "" _MiB(unsigned long long v) { - return v * 1024 * 1024; -} - namespace map { constexpr region_t local_sram_0 { 0x10000000, 96_KiB }; diff --git a/firmware/common/utility.hpp b/firmware/common/utility.hpp index 1407f687..be341042 100644 --- a/firmware/common/utility.hpp +++ b/firmware/common/utility.hpp @@ -32,6 +32,14 @@ #define LOCATE_IN_RAM __attribute__((section(".ramtext"))) +constexpr size_t operator "" _KiB(unsigned long long v) { + return v * 1024; +} + +constexpr size_t operator "" _MiB(unsigned long long v) { + return v * 1024 * 1024; +} + template constexpr typename std::underlying_type::type toUType(E enumerator) noexcept { /* Thanks, Scott Meyers! */