init __pikaMain manually to support task and debug when launch in script

This commit is contained in:
李昂 2022-02-20 13:49:36 +00:00 committed by Gitee
parent 414cc86bf4
commit c3f33183fb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -88,6 +88,8 @@ char __platform_getchar(){
return res;
}
extern PikaObj *__pikaMain;
int main(void){
HAL_Init();
SystemClock_Config();
@ -113,6 +115,7 @@ int main(void){
if (code[0] != 0xFF) {
/* boot from flash */
pikaMain = newRootObj("pikaMain", New_PikaMain);
__pikaMain = pikaMain;
if (code[0] == 'i') {
printf("[info]: boot from Script.\r\n");
Arg* codeBuff = arg_setStr(NULL, "", code);