From 66d8e6fdbbac1a0a90db6c1900a0a0776c73a3d5 Mon Sep 17 00:00:00 2001 From: dgjames <1943357252@qq.com> Date: Fri, 14 Mar 2025 22:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D=EF=BC=8C=E6=8E=A5=E7=BA=BF?= =?UTF-8?q?=EF=BC=8Cdanger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++ applications/{uart_sample.c => assistant.c} | 6 ++++ applications/assistant.h | 1 + applications/status.c | 32 +++++++++++++++++++++ 4 files changed, 45 insertions(+) rename applications/{uart_sample.c => assistant.c} (97%) create mode 100644 applications/assistant.h create mode 100644 applications/status.c diff --git a/README.md b/README.md index f3ad36c..ffcc479 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +### 接线 +语音助手 +TX:PD8 +RX:PD9 + + # 红外遥控贪吃蛇/显示+上传温度等数据 ![简略教程封面](/my_picture/简略教程封面.jpg) diff --git a/applications/uart_sample.c b/applications/assistant.c similarity index 97% rename from applications/uart_sample.c rename to applications/assistant.c index 5fdbff0..0eec5c7 100644 --- a/applications/uart_sample.c +++ b/applications/assistant.c @@ -94,6 +94,12 @@ static void serial_thread_entry(void *parameter) } } + +void serial_send(char *str) +{ + rt_device_write(serial, 0, str, (sizeof(str) - 1)); +} + int aiv_init(void) { LOG5("VOICE assistant START"); diff --git a/applications/assistant.h b/applications/assistant.h new file mode 100644 index 0000000..5122f05 --- /dev/null +++ b/applications/assistant.h @@ -0,0 +1 @@ +void serial_send(char *str); \ No newline at end of file diff --git a/applications/status.c b/applications/status.c new file mode 100644 index 0000000..09eae5f --- /dev/null +++ b/applications/status.c @@ -0,0 +1,32 @@ + +#include +#include +#include +#include +#include + + +#define THREAD_PRIORITY 25 +#define THREAD_STACK_SIZE 4096 +#define THREAD_TIMESLICE 5 + +#define LOG_TAG "status" +#define DBG_LVL DBG_LOG +// #define DBG_LVL DBG_INFO + +#define USE_LOG1 +#define USE_LOG2 +#define USE_LOG3 +// #define USE_LOG4 +#define USE_LOG5 +// #define USE_LOG6 +// #define USE_LOG_D +#include "logn.h" + +void danger_status(void) +{ + char *str = "aa"; + serial_send(str); + sim_call("17318112360"); +} +MSH_CMD_EXPORT_ALIAS(danger_status, danger, show danger_status); \ No newline at end of file