适配系统适配层的更新

This commit is contained in:
2026-04-23 14:48:24 +08:00
parent d9873206cc
commit fd4b7ebf9d
10 changed files with 159 additions and 52 deletions

View File

@@ -7,8 +7,9 @@ void msg_handle_cb(unsigned char module_id, const unsigned char *buf, unsigned i
}
static OS_THREAD_ID wifi_tid;
void *wifi_task(void *param)
static void wifi_task(void *param)
{
(void)param;
uint8_t buffer[10] = {1, 2, 8};
uint8_t data[2];
data[0] = 0x5c;
@@ -25,16 +26,24 @@ void *wifi_task(void *param)
has_msg_handle(WIFI, msg_handle_cb, 1000);
has_msg_publish(WIFI, data, sizeof(data));
}
return NULL;
}
int example_wifi_init(void)
{
has_task_attr_t task_attr = {
.name = "wifi",
.entry = wifi_task,
.arg = NULL,
.stack_size_bytes = 1024U,
.priority = HAS_TASK_PRIORITY_NORMAL,
.linux_attr = { .sched_policy = -1 },
};
printf("module:WIFI\n");
// has_msg_printf_subscribe(WIFI);
/* 创建线程 */
if (has_task_create("wifi", TASK_PRIORITY_NORMAL, 1024, wifi_task, NULL, &wifi_tid) != 0) {
if (has_task_create(&task_attr, &wifi_tid) != 0) {
printf("module:WIFI create task failed\n");
return -1;
}