first init
This commit is contained in:
27
has_project/has_app/gui/has_gui.c
Normal file
27
has_project/has_app/gui/has_gui.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "has_platform.h"
|
||||
|
||||
static OS_THREAD_ID gui_tid;
|
||||
void *gui_task(void *param)
|
||||
{
|
||||
uint8_t data[2];
|
||||
data[0] = 0x5a;
|
||||
data[1] = 0x5b;
|
||||
while (1)
|
||||
{
|
||||
has_msg_publish(GUI, data, sizeof(data));
|
||||
sleep(10);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int example_gui_init(void)
|
||||
{
|
||||
printf("module:GUI\n");
|
||||
/* 创建线程 */
|
||||
if (has_task_create("wifi", TASK_PRIORITY_NORMAL, 1024, gui_task, NULL, &gui_tid) != 0) {
|
||||
printf("module:WIFI create task failed\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
HAS_DECLARE_MODULE(GUI, example_gui_init)
|
||||
Reference in New Issue
Block a user