diff --git a/applications/drv_ec800k.c b/applications/drv_ec800k.c index 8158480..9c476c3 100644 --- a/applications/drv_ec800k.c +++ b/applications/drv_ec800k.c @@ -73,6 +73,7 @@ int16_t BSP_LTE_CipSend(uint8_t *pdata, uint32_t length, uint32_t waittime) { int16_t BSP_LTE_SendCmd(const char *cmd, const char *expect, const char *error, uint32_t waittime) { rt_kprintf("%s\n", cmd); + hw_printf("%s\n", cmd); BSP_LTE_SendData((uint8_t *)cmd, rt_strlen(cmd)); rt_err_t ret = rt_sem_take(lte_dev.com_dev_rx_sem, waittime); @@ -84,7 +85,7 @@ int16_t BSP_LTE_SendCmd(const char *cmd, const char *expect, const char *error, rt_device_read(lte_dev.com_dev, 0, lte_dev.at_buf, sizeof(lte_dev.at_buf)); rt_kprintf("%s\n", lte_dev.at_buf); - + hw_printf("%s\n", lte_dev.at_buf); /* 清空缓存 */ uint8_t c; while (rt_device_read(lte_dev.com_dev, 0, &c, 1) == 1) { diff --git a/applications/drv_ec800k.h b/applications/drv_ec800k.h index 21b051a..3029725 100644 --- a/applications/drv_ec800k.h +++ b/applications/drv_ec800k.h @@ -239,6 +239,9 @@ typedef struct { rt_device_t com_dev; rt_sem_t com_dev_rx_sem; rt_uint8_t at_buf[256]; + + rt_thread_t tid1; + rt_thread_t tid2; } CLte_dev_t; extern CLte_dev_t lte_dev; diff --git a/applications/main.c b/applications/main.c index 80205d2..18dcaaf 100644 --- a/applications/main.c +++ b/applications/main.c @@ -45,13 +45,13 @@ int main(void) { BSP_LET_Register_Com(u2); /* 创建任务2和任务3,分别从U2和U3收发数据 */ - rt_thread_t tid = - rt_thread_create("lte", task_let_entry, RT_NULL, 1024 + 512, 10, 5); - if (tid) { - rt_thread_startup(tid); + lte_dev.tid1 = + rt_thread_create("lte", task_let_entry, RT_NULL, 2048, 10, 5); + if (lte_dev.tid1) { + rt_thread_startup(lte_dev.tid1); } - tid = rt_thread_create("com", task_com_entry, RT_NULL, 1024, 11, 5); - if (tid) { - rt_thread_startup(tid); + lte_dev.tid2 = rt_thread_create("com", task_com_entry, RT_NULL, 1024, 11, 5); + if (lte_dev.tid2) { + rt_thread_startup(lte_dev.tid2); } }