From d9873206cce2eef7de2c1f02ef474eb8354a7f10 Mon Sep 17 00:00:00 2001 From: zhangzhaopeng Date: Tue, 14 Apr 2026 18:25:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8DHSP=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ has_platform | 2 +- has_project/has_app/gui/has_gui.c | 9 +++++++++ has_project/has_platform_config.h | 14 ++++++++++---- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 55f7612..a3999a5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +获取HSP子仓库 +git submodule init +git submodule update 编译: ./build.sh all embed 运行: diff --git a/has_platform b/has_platform index 3f12088..304f035 160000 --- a/has_platform +++ b/has_platform @@ -1 +1 @@ -Subproject commit 3f12088b325425cc492e83c5fb465369a2cc3bfa +Subproject commit 304f035f44f9dcd133cc72e72b31b864618c79a2 diff --git a/has_project/has_app/gui/has_gui.c b/has_project/has_app/gui/has_gui.c index f2d6d09..18e7c50 100644 --- a/has_project/has_app/gui/has_gui.c +++ b/has_project/has_app/gui/has_gui.c @@ -1,11 +1,20 @@ #include "has_platform.h" +static void timer_cb(void *arg) +{ + (void)arg; + printf("hello timer\n"); + has_timer_set(timer_cb, NULL, 1000); +} + static OS_THREAD_ID gui_tid; void *gui_task(void *param) { + (void)param; uint8_t data[2]; data[0] = 0x5a; data[1] = 0x5b; + has_timer_set(timer_cb, NULL, 1000); while (1) { has_msg_publish(GUI, data, sizeof(data)); diff --git a/has_project/has_platform_config.h b/has_project/has_platform_config.h index 615bd1c..7fac6d5 100644 --- a/has_project/has_platform_config.h +++ b/has_project/has_platform_config.h @@ -21,19 +21,25 @@ {WIFI, 1, {GUI}}, \ {ACM, 2, {WIFI, GUI}}, \ } +#define CEHCK_CONFIG_H 1 // 如果打开,代码初始化时会检查config是否写错,开发时应该打开 -/* 如果打开,代码初始化时会检查config是否写错,开发时应该打开 */ -#define CEHCK_CONFIG_H 1 - +/* 4.选择操作系统 */ #define HAS_OS_LINUX // Linux系统 // #define HAS_OS_freeRTOS // freeRTOS系统 // #define HAS_OS_RT_THREAD // rt-thread系统 // #define HAS_OS_NONE_OR_OSAL // 裸机或osal // #define HAS_OS_USER_DEFINED // 自定义,806 - #ifdef HAS_OS_USER_DEFINED /* 这里包含自定义的头文件 */ #include "has_806_os_port/has_os_806_port.h" #endif +/* 5.打开需要的模块 */ +#define HAS_ENABLE_TIMER // 启用软件定时器模块 +#define HAS_ENABLE_IOBUFFER // 协议数据缓冲区管理 +#define HAS_ENABLE_PROTOCOL // HAS协议模块 +// #define HAS_ENABLE_CRC // CRC +// #define HAS_ENABLE_CJSON // CJSON +// #define HAS_ENABLE_MD5 // MD5 + #endif