完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
HelloWorld_Thread:线程函数 Initialize_Demo:初始化函数 App_Start:主体函数
/**PAL_OUTPUT_END_OF_LINE_STRING @brief This function is used to pre initialize resource required before starting the demo this is called from app_init function in pal.c */ void Initialize_Demo(void) { PAL_CONSOLE_WRITE_STRING_LITERAL("Hello World demo - Welcome to QCA IoE rn"); PAL_CONSOLE_WRITE_STRING_LITERAL(PAL_OUTPUT_END_OF_LINE_STRING); }
/** @brief This function is used to start the demo thread this is called from app_init function in pal.c */ void App_Start(qbool_t ColdBoot) { qurt_thread_attr_t Thread_Attribte; qurt_thread_t Thread_Handle; int Result; /* Start the main demo app. */ qurt_thread_attr_init(&Thread_Attribte); //初始化线程属性 qurt_thread_attr_set_name(&Thread_Attribte, "HelloThread"); //设置线程的名称 qurt_thread_attr_set_priority(&Thread_Attribte, THREAD_PRIORITY); //设置线程的优先级 qurt_thread_attr_set_stack_size(&Thread_Attribte, THREAD_STACK_SIZE); //设置线程的堆栈大小 Result = qurt_thread_create(&Thread_Handle, &Thread_Attribte, HelloWorld_Thread, NULL); //创建线程 if(Result != QURT_EOK) { PAL_CONSOLE_WRITE_STRING_LITERAL("Failed to start Hello World Main thread."); PAL_CONSOLE_WRITE_STRING_LITERAL(PAL_OUTPUT_END_OF_LINE_STRING); PAL_CONSOLE_WRITE_STRING_LITERAL(PAL_OUTPUT_END_OF_LINE_STRING); } }
/** @brief This function represents the main thread of execution. */ static void HelloWorld_Thread(void *Param) { /* Say Hello World */ while(true) { PAL_CONSOLE_WRITE_STRING_LITERAL("Hello Worldrn"); PAL_CONSOLE_WRITE_STRING_LITERAL(PAL_OUTPUT_END_OF_LINE_STRING); Sleep(1000); //sleep for 1 sec } }
只有小组成员才能发言,加入小组>>
80个成员聚集在这个小组
Qualcomm_Snapdragon_VR_SDK SvrPlugin脚本简介(1)
1675 浏览 0 评论
【DragonBoard 410c试用体验】之OpenCV中canny算子边缘检测
8980 浏览 0 评论
【DragonBoard 410c】汇总帖(2016.10.25更新)
36064 浏览 2 评论
电子发烧友网
电子发烧友论坛
查看 »
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-4 01:37 , Processed in 0.690444 second(s), Total 62, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com