mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
Merge pull request #15 from mysterywolf/test
[rt-thread] 接管内存分配,实现命令行启动pika方式(用于后续支持终端键入)
This commit is contained in:
commit
6a196c66f4
@ -11,6 +11,10 @@
|
||||
#include <rtthread.h>
|
||||
#include "pikaPlatform.h"
|
||||
|
||||
#ifndef RT_USING_HEAP
|
||||
#error "Please enable heap in the RT-Thread configuration"
|
||||
#endif
|
||||
|
||||
int __platform_sprintf(char* buff, char* fmt, ...) {
|
||||
va_list args;
|
||||
int res;
|
||||
@ -25,3 +29,9 @@ int __platform_vsprintf(char* buff, char* fmt, va_list args){
|
||||
int __platform_vsnprintf(char* buff, size_t size, const char* fmt, va_list args){
|
||||
return rt_vsnprintf(buff, size, fmt, args);
|
||||
}
|
||||
void* __platform_malloc(size_t size) {
|
||||
return rt_malloc(size);
|
||||
}
|
||||
void __platform_free(void* ptr) {
|
||||
rt_free(ptr);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <rtthread.h>
|
||||
#include <pikaScript.h>
|
||||
|
||||
|
||||
#if 0
|
||||
#define PIKASCRIPT_STACK_SIZE 4096
|
||||
#define PIKASCRIPT_STACK_PRIO 20
|
||||
|
||||
@ -40,3 +40,12 @@ static int rt_pika_init(void)
|
||||
}
|
||||
|
||||
INIT_APP_EXPORT(rt_pika_init);
|
||||
|
||||
#else
|
||||
static int pika(int argc, char *argv[])
|
||||
{
|
||||
pikaScriptInit();
|
||||
return 0;
|
||||
}
|
||||
MSH_CMD_EXPORT(pika, run pikascript);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user