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