mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
add use_mem_pool define for g030
This commit is contained in:
parent
4cc4373279
commit
30fabfd58b
@ -67,6 +67,21 @@ uint8_t Shell_Ready = 0;
|
||||
* @brief The application entry point.
|
||||
* @retval int
|
||||
*/
|
||||
|
||||
#define use_mem_pool
|
||||
|
||||
#ifdef use_mem_pool
|
||||
/* use mem pool */
|
||||
Pool pikaPool;
|
||||
void* __impl_pikaMalloc(size_t size) {
|
||||
void* mem = pool_malloc(&pikaPool, size);
|
||||
return mem;
|
||||
}
|
||||
void __impl_pikaFree(void* ptrm, size_t size) {
|
||||
pool_free(&pikaPool, ptrm, size);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
/* support bootLoader */
|
||||
__disable_irq();
|
||||
@ -79,8 +94,12 @@ int main(void) {
|
||||
MX_GPIO_Init();
|
||||
HARDWARE_PRINTF_Init();
|
||||
|
||||
/* init mem pool */
|
||||
#ifdef use_mem_pool
|
||||
pikaPool = pool_init(0x1B00, 4);
|
||||
#endif
|
||||
printf("stm32 hardware init ok\r\n");
|
||||
|
||||
|
||||
/* boot pikaScript */
|
||||
char* code = (char*)FLASH_SCRIPT_START_ADDR;
|
||||
if (code[0] != 0xFF) {
|
||||
|
0
port/linux/api-make-linux.sh
Executable file → Normal file
0
port/linux/api-make-linux.sh
Executable file → Normal file
0
port/linux/api-make-win10.sh
Executable file → Normal file
0
port/linux/api-make-win10.sh
Executable file → Normal file
0
port/linux/api-make.sh
Executable file → Normal file
0
port/linux/api-make.sh
Executable file → Normal file
0
port/linux/gtest.sh
Executable file → Normal file
0
port/linux/gtest.sh
Executable file → Normal file
0
port/linux/init.sh
Executable file → Normal file
0
port/linux/init.sh
Executable file → Normal file
0
port/linux/make.sh
Executable file → Normal file
0
port/linux/make.sh
Executable file → Normal file
0
port/linux/package/pikascript/rust-msc-latest-linux
Executable file → Normal file
0
port/linux/package/pikascript/rust-msc-latest-linux
Executable file → Normal file
0
port/linux/pull-core.sh
Executable file → Normal file
0
port/linux/pull-core.sh
Executable file → Normal file
0
port/linux/push-core.sh
Executable file → Normal file
0
port/linux/push-core.sh
Executable file → Normal file
0
port/linux/test-banchmark.sh
Executable file → Normal file
0
port/linux/test-banchmark.sh
Executable file → Normal file
0
port/linux/update-compiler.sh
Executable file → Normal file
0
port/linux/update-compiler.sh
Executable file → Normal file
Loading…
x
Reference in New Issue
Block a user