适配系统适配层的更新
This commit is contained in:
@@ -8,7 +8,7 @@ static void timer_cb(void *arg)
|
||||
}
|
||||
|
||||
static OS_THREAD_ID gui_tid;
|
||||
void *gui_task(void *param)
|
||||
static void gui_task(void *param)
|
||||
{
|
||||
(void)param;
|
||||
uint8_t data[2];
|
||||
@@ -18,17 +18,25 @@ void *gui_task(void *param)
|
||||
while (1)
|
||||
{
|
||||
has_msg_publish(GUI, data, sizeof(data));
|
||||
sleep(10);
|
||||
has_sleep_ms(10000);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int example_gui_init(void)
|
||||
{
|
||||
has_task_attr_t task_attr = {
|
||||
.name = "gui",
|
||||
.entry = gui_task,
|
||||
.arg = NULL,
|
||||
.stack_size_bytes = 1024U,
|
||||
.priority = HAS_TASK_PRIORITY_NORMAL,
|
||||
.linux_attr = { .sched_policy = -1 },
|
||||
};
|
||||
|
||||
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");
|
||||
if (has_task_create(&task_attr, &gui_tid) != 0) {
|
||||
printf("module:GUI create task failed\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user