kopia lustrzana https://github.com/pimoroni/pimoroni-pico
MicroPython: Switch C++ allocation mode in boot.py.
rodzic
667faf70d1
commit
2c0310ca9a
|
@ -105,14 +105,4 @@ void operator delete(void *p, __unused std::size_t n) noexcept { stat_free(p); }
|
|||
|
||||
void operator delete[](void *p, __unused std::size_t n) noexcept { stat_free(p); }
|
||||
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
struct SwitchAllocatorMode {
|
||||
public:
|
||||
SwitchAllocatorMode() {
|
||||
mode = MICROPYTHON;
|
||||
}
|
||||
};
|
||||
SwitchAllocatorMode switchallocatormode __attribute__ ((init_priority (65535)));
|
||||
}
|
||||
#endif
|
|
@ -40,6 +40,7 @@ include(motor/micropython)
|
|||
# include(micropython-common)
|
||||
|
||||
include(modules_py/modules_py)
|
||||
copy_module(boot.py)
|
||||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
|
@ -48,6 +48,7 @@ if(PICO_BOARD STREQUAL "pico_w")
|
|||
copy_module(automation.py)
|
||||
copy_module(inventor.py)
|
||||
endif()
|
||||
copy_module(boot.py)
|
||||
|
||||
# Must call `enable_ulab()` to enable
|
||||
include(micropython-common-ulab)
|
|
@ -35,6 +35,7 @@ include(micropython-common-ulab)
|
|||
enable_ulab()
|
||||
|
||||
include(modules_py/modules_py)
|
||||
copy_module(boot.py)
|
||||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
|
|
@ -45,6 +45,7 @@ include(motor/micropython)
|
|||
# include(micropython-common)
|
||||
|
||||
include(modules_py/modules_py)
|
||||
copy_module(boot.py)
|
||||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
|
@ -35,6 +35,7 @@ include(micropython-common-ulab)
|
|||
enable_ulab()
|
||||
|
||||
include(modules_py/modules_py)
|
||||
copy_module(boot.py)
|
||||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
|
|
@ -46,6 +46,7 @@ include(motor/micropython)
|
|||
include(modules_py/modules_py)
|
||||
|
||||
copy_module(inky_frame.py)
|
||||
copy_module(boot.py)
|
||||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
|
|
@ -40,6 +40,7 @@ include(micropython-common-ulab)
|
|||
enable_ulab()
|
||||
|
||||
include(modules_py/modules_py)
|
||||
copy_module(boot.py)
|
||||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
|
@ -0,0 +1,3 @@
|
|||
import cppmem
|
||||
# Switch C++ memory allocations to use MicroPython's heap
|
||||
cppmem.set_mode(cppmem.MICROPYTHON)
|
Ładowanie…
Reference in New Issue