2021-12-08 08:03:29 -05:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
2021-12-08 21:41:39 +08:00
|
|
|
* 2021-12-07 lyon the first version
|
2021-12-08 08:03:29 -05:00
|
|
|
*/
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include <pikaScript.h>
|
|
|
|
|
2021-12-08 12:20:24 -05:00
|
|
|
#if 0
|
2021-12-08 08:10:57 -05:00
|
|
|
#define PIKASCRIPT_STACK_SIZE 4096
|
2021-12-08 08:03:29 -05:00
|
|
|
#define PIKASCRIPT_STACK_PRIO 20
|
|
|
|
|
|
|
|
static void pikascript_entry(void *parameter)
|
|
|
|
{
|
|
|
|
pikaScriptInit();
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rt_pika_init(void)
|
|
|
|
{
|
|
|
|
rt_thread_t tid;
|
|
|
|
tid = rt_thread_create("PikaScript",
|
|
|
|
pikascript_entry, RT_NULL,
|
|
|
|
PIKASCRIPT_STACK_SIZE,
|
|
|
|
PIKASCRIPT_STACK_PRIO, 0);
|
|
|
|
|
|
|
|
if (tid != RT_NULL)
|
|
|
|
{
|
|
|
|
rt_thread_startup(tid);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2021-12-08 21:41:39 +08:00
|
|
|
|
2021-12-08 08:03:29 -05:00
|
|
|
INIT_APP_EXPORT(rt_pika_init);
|
2021-12-08 12:20:24 -05:00
|
|
|
|
|
|
|
#else
|
|
|
|
static int pika(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
pikaScriptInit();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
MSH_CMD_EXPORT(pika, run pikascript);
|
|
|
|
#endif
|