add use_mem_pool define for g030

This commit is contained in:
pikastech 2021-11-15 23:23:43 +08:00
parent 4cc4373279
commit 30fabfd58b
12 changed files with 20 additions and 1 deletions

View File

@ -67,6 +67,21 @@ uint8_t Shell_Ready = 0;
* @brief The application entry point. * @brief The application entry point.
* @retval int * @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) { int main(void) {
/* support bootLoader */ /* support bootLoader */
__disable_irq(); __disable_irq();
@ -79,8 +94,12 @@ int main(void) {
MX_GPIO_Init(); MX_GPIO_Init();
HARDWARE_PRINTF_Init(); HARDWARE_PRINTF_Init();
/* init mem pool */
#ifdef use_mem_pool
pikaPool = pool_init(0x1B00, 4);
#endif
printf("stm32 hardware init ok\r\n"); printf("stm32 hardware init ok\r\n");
/* boot pikaScript */ /* boot pikaScript */
char* code = (char*)FLASH_SCRIPT_START_ADDR; char* code = (char*)FLASH_SCRIPT_START_ADDR;
if (code[0] != 0xFF) { if (code[0] != 0xFF) {

0
port/linux/api-make-linux.sh Executable file → Normal file
View File

0
port/linux/api-make-win10.sh Executable file → Normal file
View File

0
port/linux/api-make.sh Executable file → Normal file
View File

0
port/linux/gtest.sh Executable file → Normal file
View File

0
port/linux/init.sh Executable file → Normal file
View File

0
port/linux/make.sh Executable file → Normal file
View File

0
port/linux/package/pikascript/rust-msc-latest-linux Executable file → Normal file
View File

0
port/linux/pull-core.sh Executable file → Normal file
View File

0
port/linux/push-core.sh Executable file → Normal file
View File

0
port/linux/test-banchmark.sh Executable file → Normal file
View File

0
port/linux/update-compiler.sh Executable file → Normal file
View File