/* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA"). * All rights reserved. * * This software is supplied "AS IS" without any warranties. * RDA assumes no responsibility or liability for the use of the software, * conveys no license or title under any patent, copyright, or mask work * right to the product. RDA reserves the right to make changes in the * software without notification. RDA also make no representation or * warranty that such application will be suitable for the specified use * without further testing or modification. */ //#define OSI_LOG_TAG OSI_MAKE_LOG_TAG() #include "includes.h" /* appimg_exit 仅在程序退出时打印 */ void appimg_exit(void){ LSAPI_Log_Debug("application image exit"); } void startSubTask(void); static void mainTask(void *param){ dataInit(); boardInit(); startSubTask();//线程会调用外设接口,必须在boardInit后启动 appRun();//应用主程序(pt) } /* appimg_enter cat one入口函数 */ LSAPI_OSI_Thread_t * mainThreadPtr=NULL; int appimg_enter(void *param){ if(NULL==(mainThreadPtr=LSAPI_OSI_ThreadCreate("main", mainTask, NULL, LSAPI_OSI_PRIORITY_NORMAL, PT_THREAD_STACK, 5))){ for(;;){ LSAPI_Log_Debug("main task failed"); LSAPI_OSI_ThreadSleep(1000); } } return 0; } void startSubTask(void){ if(NULL==LSAPI_OSI_ThreadCreate("sub", subTask, NULL, LSAPI_OSI_PRIORITY_NORMAL, SUB_TASK_THREAD_STACK, 10)){ MSG_ERR(1, "sub task failed"); }else MSG_ERR(1, "sub task ok"); }