From 5ba77d20e5a66e9cf6a29c8d6554694c6b6fdf89 Mon Sep 17 00:00:00 2001 From: "CSSC-WORK\\murmur" Date: Fri, 16 Jun 2023 11:18:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E5=87=BD=E6=95=B0=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E6=AD=A3=E5=B8=B8=E5=B7=A5=E4=BD=9C=20tcp=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=9F=BA=E6=9C=AC=E6=AD=A3=E5=B8=B8=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/TODO.md | 5 ++ applications/_main.c | 32 +++++--- applications/cfg.ini | 47 +++++++++++ applications/main.c | 8 +- applications/tools.c | 146 +++++++++++++++++++++++++++++---- applications/ttTR.c | 79 ++++++++++++------ applications/ttTR.h | 3 + applications/ttmsg/ttmsg.c | 65 ++++++++++++--- applications/uart_dma_sample.c | 95 +++++++++++++-------- applications/usrcfg.h | 3 +- rtconfig.h | 2 +- 11 files changed, 378 insertions(+), 107 deletions(-) create mode 100644 applications/TODO.md create mode 100644 applications/cfg.ini diff --git a/applications/TODO.md b/applications/TODO.md new file mode 100644 index 0000000..6142b29 --- /dev/null +++ b/applications/TODO.md @@ -0,0 +1,5 @@ +- 完成TT发送数据 +- 解决打包文件错误问题 +- 定时发送数据 +- TT接收数据 +- 完成开窗功能 \ No newline at end of file diff --git a/applications/_main.c b/applications/_main.c index 51f1162..2f9b5be 100644 --- a/applications/_main.c +++ b/applications/_main.c @@ -21,6 +21,7 @@ #include static struct rt_event sw_check;//软件条件 static struct rt_event hw_check;//硬件条件 +struct rt_event tcp_chk;//tcp条件 //#define FILE_IS_OK 1 //#define TIMER_IS_OUT 1<<1 //#define TT_IS_OK 1<<2 @@ -34,7 +35,9 @@ static void initEvent(void) /* 事 件 控 制 块 */ rt_err_t result = rt_event_init(&sw_check, "SHcheck", RT_IPC_FLAG_PRIO); - result = rt_event_init(&hw_check, "HWcheck", RT_IPC_FLAG_PRIO); + result = rt_event_init(&hw_check, "HWcheck", RT_IPC_FLAG_PRIO) | result; + result = rt_event_init(&tcp_chk, "tcpTT", RT_IPC_FLAG_PRIO) | result; + if (result != RT_EOK) { LOG_E("init event failed.\n"); @@ -132,7 +135,7 @@ static void getFileData_thread_entry(void) { //get file to be send - char *f="2023_05_22_11_27_12_245.txt"; + char *f="2023_06_16_10_28_00_123.bin"; // char *f="1023_05_19_15_29_59_254.txt"; // pack file @@ -143,20 +146,23 @@ static void getFileData_thread_entry(void) #ifdef __PCK // LOG_D("%p--%p",d,s); // LOG_I("pack %s ...",f); - static MSG cfg; - rt_memset(&cfg, 0, sizeof(MSG)); // 分配空间 +// static MSG cfg; +// rt_memset(&cfg, 0, sizeof(MSG)); // 分配空间 len = pack_File(f, 0, d, s); rt_kprintf("len is %d\n", len); - if (len) - { - for (size_t var = 0; var < len; var++) { - LOG_HEX("d",27,d[var],s[var]); -// sendMsg(d[var], s[var]); - } - sendMsgs(d, s, len); - LOG_I("Done."); - } + if (len && (tcpInit() == RT_EOK)) + { + // rt_event_send(&tcp_chk, TT_TCP_OK); + for (size_t var = 0; var < len; var++) + { + sendMsg(d[var], s[var]); + LOG_D("i = %d",var); + LOG_HEX("d", 27, d[var], s[var]); + } + tcpClose(); + LOG_I("Done."); + } #else diff --git a/applications/cfg.ini b/applications/cfg.ini new file mode 100644 index 0000000..933d3f6 --- /dev/null +++ b/applications/cfg.ini @@ -0,0 +1,47 @@ +[config] +# V1.4 +#发送间隔(M),以零点为基准时刻 +sendInterval=60 +# 用于保存串口数据的单文件最大值(Byte) +maxSizePerFile=4096 +# 最长等待数据时间,超时后将已收数据存盘 +MaxTimeoutToSave=20 +# 最小文件大小,超过此大小则进入发送流程 +minSizeToSend=4096 +# 最小等待时间(S),超时后进入待机模式 +minSecToSleep=30 +# TT最长等待激活时间(M),超时后重启 +maxTTWaitTime=4 +# TT最大重试次数 +maxTTRetryCnt=3 +# TT最低信号值 +minTTsinal=5 +# TT状态检测周期数 +minTTPeriCnt=5 +compressType=1 +encrytType=1 +# 开窗时间(UTC+8),持续时间(H)。支持多组,组与组之间采用【;】为分隔符 +openWindowTime=9,1;15;1 + +[stats] +# 继电器开关次数,影响继电器寿命(<10W次) +swCnt=12 +# 第一次上电就满足硬件条件的次数, +oneShotCnt=0 +# 重启次数 +bootCnt=13 +# 发送总次数,由软件条件触发 +sendCnt=0 +# TT初始化失败次数,由MaxRetryCnt次失败后触发 +errCnt=0 +# 最短激活时间 +minActiveTime=0 +# 最长激活时间 +maxActiveTime=0 +# 平均激活时间,暂不考虑实现 +meanActiveTime=0 +[tosend] +# 文件名=待发包。值为0表示全发。 +2023_05_22_11_27_12_245.txt=12 +1023_05_19_15_29_59_254.txt=1 +123_00_00_00_00_00_00.txt=0 diff --git a/applications/main.c b/applications/main.c index ad815f6..0bbf12f 100644 --- a/applications/main.c +++ b/applications/main.c @@ -25,9 +25,9 @@ void pfdemo(void) // #define cmb_println(...) rt_kprintf(__VA_ARGS__);rt_kprintf("\r\n"); // char *f = "1023_05_19_15_29_59_254.txt"; // char *f = "2023_05_19_15_29_59_255.txt"; - char *f = "2023_05_22_11_27_12_245.txt"; - static rt_uint8_t d[10][200] = { }; - static rt_uint8_t s[10] = { }; + char *f = "2023_06_16_10_28_00_123.bin"; + static rt_uint8_t d[50][200] = { }; + static rt_uint8_t s[50] = { }; rt_uint8_t len = 0; LOG_D("%p--%p",d,s); LOG_I("pack %s ...",f); @@ -35,7 +35,7 @@ void pfdemo(void) rt_kprintf("len is %d\n", len); if (len) { - for (size_t var = 0; var < len; ++var) { + for (size_t var = 0; var < len; var++) { LOG_HEX("d",27,d[var],s[var]); } // LOG_HEX("pkdata:",27,d[0],s[0]); diff --git a/applications/tools.c b/applications/tools.c index 07d3040..4b7aedc 100644 --- a/applications/tools.c +++ b/applications/tools.c @@ -8,19 +8,27 @@ #include #include -#ifdef _CFGALL -int sendInterval =60; -int maxTTWaitTime = 4; -int maxTTRetryCnt = 3; -int minTTPeriCnt=5; -int minTTsinal=5; -/** - * 以HEX显示文件内容 - */ -void hex() +typedef struct { + int sendInterval; + int maxTTWaitTime; + int maxTTRetryCnt; + int minTTPeriCnt; + int minTTsinal; +} SYS_CFG; + +//#define _CFGALL +#ifdef _CFGALL + +SYS_CFG scfg={ + .sendInterval =60, + .maxTTWaitTime = 4, + .maxTTRetryCnt = 3, + .minTTPeriCnt=5, + .minTTsinal=5, +}; + -} /** * 更新全局参数 @@ -30,17 +38,119 @@ void updatecfg(void) //因为不知原因,采用事件集独立更新配置出错 //独立响应单个参数更新事件,程序上更复杂也没特别必要 //现采用事件通知、统一全部重新加载 -while(1) -{ - maxTTWaitTime = get_cfg("maxTTWaitTime"); - maxTTRetryCnt = get_cfg("maxTTRetryCnt"); - static int minTTPeriCnt=5; - static int minTTsinal=5; -} + while(1) + { + maxTTWaitTime = get_cfg("maxTTWaitTime"); + maxTTRetryCnt = get_cfg("maxTTRetryCnt"); + minTTPeriCnt = get_cfg("minTTPeriCnt"); + minTTsinal = get_cfg("minTTsinal"); + } } #endif +/** + * 以HEX显示文件内容 + */ +void hexFile_thread_entry(void* parameter) +{ + int fd_in = -1; + int block_size = 0; + char *fin = (char *)parameter; + fd_in = open(fin, O_RDONLY, 0); + if (fd_in < 0) + { + rt_kprintf("[hex] open the input file : %s error!\n", fin); + return RT_ERROR; + } + size_t file_size = lseek(fd_in, 0, SEEK_END); + lseek(fd_in, 0, SEEK_SET); + + rt_uint8_t *buffer = RT_NULL; +#define READ_BUFFER_SIZE 512 + buffer = (rt_uint8_t *) malloc(READ_BUFFER_SIZE); + rt_kprintf("------Start------\n"); + for (size_t i = 0; i < file_size; i += READ_BUFFER_SIZE) + { + if ((file_size - i) < READ_BUFFER_SIZE) + { + block_size = file_size - i; + } + else + { + block_size = READ_BUFFER_SIZE; + } + + memset(buffer, 0x00, READ_BUFFER_SIZE); + read(fd_in, buffer, block_size); + LOG_HEX("hex_file:",27,buffer,block_size); + } + + rt_free(buffer); + close(fd_in); + rt_kprintf("------Done.------\n"); +} + +void hexFile(int argc, char **argv) +{ + + if (argc == 2) + { + static char f[30]; + rt_strcpy(f,argv[1]); + /* 创建线程 */ + rt_thread_t thread = rt_thread_create("hex_file", hexFile_thread_entry, (void *) f, 1024 * 1, 25, 10); + /* 创建成功则启动线程 */ + if (thread != RT_NULL) + { + rt_thread_startup(thread); + } + else + { + LOG_E("thread 'hex_file' create failure."); + return RT_ERROR; + } + } +} +MSH_CMD_EXPORT(hexFile,以HEX方式显示文件内容); + +/** + * 将当前时间转为字符串 + * @param str 字符串buffer + * @return 字符串长度 + */ +int time2Str(char *str) +{ + struct tm *tm, tm_tmp; + time_t now = time(RT_NULL); + time_t t = (time_t)0; + + if (gettimeofday(&now, RT_NULL) >= 0) + { +// t = now.tv_sec; + } + tm = localtime_r(&t, &tm_tmp); + +// static time_t now; +// static struct tm *tm, tm_tmp; +// +// now = time(RT_NULL); +// tm = gmtime_r(&now, &tm_tmp); + + /* show the time format MM-DD HH:MM:SS */ + size_t len = rt_snprintf(str, 20, "%04d_%02d_%02d_%02d_%02d_%02d_%03d", tm->tm_year, tm->tm_mon, + tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); + str[len]='\0'; + + return len; + +} + + + + + + void sDemo() { // extern struct rt_event sw_check;//软件条件 diff --git a/applications/ttTR.c b/applications/ttTR.c index 03aa798..a5f920f 100644 --- a/applications/ttTR.c +++ b/applications/ttTR.c @@ -17,15 +17,16 @@ #define LOG_TAG "ttTR" #define LOG_LVL LOG_LVL_DBG #include +#include -#define BUFSZ 1024 +#define BUFSZ 200 #define RETRYCNT 10 -#define URL "10.10.10.72" +#define URL TTIP #define PORT 8005 -int sock=0; +static int sock=0; -static void tcpClose(void) +void tcpClose(void) { /* 关闭这个连接 */ if (sock) { @@ -34,7 +35,7 @@ static void tcpClose(void) } -static int tcpInit(void) +int tcpInit(void) { int ret; @@ -95,7 +96,31 @@ static int tcpSend(const rt_uint8_t *send_data, size_t len) return ret; } -static int tcpRec() +/** + * 接收TCP数据 + * @param recv_data 接收数据缓存,最小200字节 + * @return 接收到的数据长度,-1表示发生了错误。 + */ + +int tcpRec(unsigned char *recv_data) +{ + int ret=RT_ERROR; + /* 从sock连接中接收最大BUFSZ字节数据 */ + int bytes_received = recv(sock, recv_data, BUFSZ, 0); + if (bytes_received) { + return bytes_received; + } + else { + LOG_E("received error."); + return -RT_ERROR; + } +} + +/** + * 发送数据时TT的ack信号 + * @return + */ +static int tcpAck() { /* 分配用于存放接收数据的缓冲 */ char *recv_data; @@ -111,7 +136,7 @@ static int tcpRec() while (cnt--) { /* 从sock连接中接收最大BUFSZ - 1字节数据 */ - int bytes_received = recv(sock, recv_data, BUFSZ - 1, 0); + int bytes_received = recv(sock, recv_data, BUFSZ, 0); if (bytes_received) { LOG_HEX("rec data",16,recv_data,bytes_received); //check response @@ -147,10 +172,10 @@ static int tcpRec() int sendMsg(const rt_uint8_t *msg, size_t len) { - if (tcpInit() != RT_EOK) - { - return RT_ERROR; - } +// if (tcpInit() != RT_EOK) +// { +// return RT_ERROR; +// } if (tcpSend(msg, len) != RT_EOK) { @@ -158,13 +183,13 @@ int sendMsg(const rt_uint8_t *msg, size_t len) return RT_ERROR; } - if (tcpRec() != RT_EOK) - { - tcpClose(); - return RT_ERROR; - }; +// if (tcpRec() != RT_EOK) +// { +// tcpClose(); +// return RT_ERROR; +// }; - tcpClose(); +// tcpClose(); return RT_EOK; } @@ -178,27 +203,31 @@ int sendMsg(const rt_uint8_t *msg, size_t len) */ int sendMsgs(const rt_uint8_t (*msg)[200], char *s, size_t row) { + int ret = RT_EOK; if (tcpInit() != RT_EOK) { - return RT_ERROR; + ret = RT_ERROR; + return ret; } for (size_t var = 0; var < row; var++) { if (tcpSend(msg[var], s[row]) != RT_EOK) { - tcpClose(); - return RT_ERROR; + ret = RT_ERROR; + break; } - - if (tcpRec() != RT_EOK) +#ifdef CHK_ACK + if (tcpAck() != RT_EOK) { - tcpClose(); - return RT_ERROR; + ret = RT_ERROR; + break; }; + +#endif } tcpClose(); - return RT_EOK; + return ret; } diff --git a/applications/ttTR.h b/applications/ttTR.h index 25b4c96..31fb3e3 100644 --- a/applications/ttTR.h +++ b/applications/ttTR.h @@ -10,7 +10,10 @@ #ifndef APPLICATIONS_TTTR_H_ #define APPLICATIONS_TTTR_H_ +int tcpInit(void); +int tcpRec(unsigned char *recv_data); int sendMsg(const rt_uint8_t *msg, size_t len); int sendMsgs(const rt_uint8_t (*msg)[200], char *s, size_t row); +void tcpClose(void); #endif /* APPLICATIONS_TTTR_H_ */ diff --git a/applications/ttmsg/ttmsg.c b/applications/ttmsg/ttmsg.c index 33fc6f8..9b466c9 100644 --- a/applications/ttmsg/ttmsg.c +++ b/applications/ttmsg/ttmsg.c @@ -35,6 +35,10 @@ #include #include #include + + extern struct rt_event tcp_chk;//tcp条件 + + /** * @brief 按指定分隔符分割字符串 * @@ -290,8 +294,8 @@ LOG_HEX("buf",16,buf,100); */ rt_uint8_t pack_File(const char *fin, rt_uint8_t flag, const rt_uint8_t (*dout)[200], rt_uint8_t *arrLen) { - extern MSG cfg; -// rt_memset(&cfg, 0, sizeof(MSG)); // 分配空间 + static MSG cfg; + rt_memset(&cfg, 0, sizeof(MSG)); // 分配空间 rt_uint8_t rst = packInit(&cfg, fin, flag); if (rst != RT_EOK) { @@ -318,6 +322,7 @@ rt_uint8_t pack_File(const char *fin, rt_uint8_t flag, const rt_uint8_t (*dout)[ LOG_I("file size is %d bytes.", file_size); lseek(fd_in, 0, SEEK_SET); rt_uint8_t *buffer = RT_NULL; +// extern rt_uint8_t *buffer; buffer = rt_malloc(file_size); if (buffer == RT_NULL) { @@ -377,11 +382,11 @@ static int pf_thread_entry(void* parameter) char *f = (char *) parameter; // static char d[5][200]; // static char s[5]; - rt_uint8_t *buffer = RT_NULL; - static MSG cfg; +// rt_uint8_t *buffer = RT_NULL; +// static MSG cfg; static rt_uint8_t len=0; -// len = pack_File(f, 0, d, s); -#define DEMO + len = pack_File(f, 0, d, s); +//#define DEMO #ifdef DEMO { // @@ -459,15 +464,16 @@ static int pf_thread_entry(void* parameter) #endif rt_kprintf("len is %d\n", len); - if (len) + if (len && (tcpInit() == RT_EOK)) { +// rt_event_send(&tcp_chk, TT_TCP_OK); for (size_t var = 0; var < len; var++) { sendMsg(d[var], s[var]); LOG_D("i = %d",var); LOG_HEX("d", 27, d[var], s[var]); } -// sendMsgs(d, s, len); + tcpClose(); LOG_I("Done."); } return RT_EOK; @@ -512,7 +518,7 @@ MSH_CMD_EXPORT(pmsg, 打包文件。); void pwTT_thread_entry(void *parameter) { // LOG_I("--%s--",parameter); - if (strcmp(parameter,"NULL")==0) + if (strcmp(parameter,"NULL")==0)//无参数 { // LOG_I("null"); int f = rt_pin_read(TT_EN); @@ -521,11 +527,13 @@ void pwTT_thread_entry(void *parameter) else { rt_bool_t flag = (rt_bool_t) atoi(parameter); -// LOG_I("flag is %d",flag); - rt_pin_write(TT_EN, flag); + if ((rt_bool_t)rt_pin_read(TT_EN) != flag) {//目标状态与当前状态一致才响应 + rt_pin_write(TT_EN, flag); + } + } - if (rt_pin_read(TT_EN)) + if (rt_pin_read(TT_EN))//检查设置后状态 { //#ifdef NO_RELAY LOG_I("set TT %s", "OFF"); @@ -565,3 +573,36 @@ static int swTT(int argc, char **argv) } MSH_CMD_EXPORT(swTT, 切换TT电源。不带参切换电源状态,支持参数); + +void recTT_thread_entry() +{ + if (rt_event_recv(&tcp_chk, TT_TCP_OK, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, + RT_WAITING_FOREVER, RT_NULL) == RT_EOK) + { + while (1) + { + + rt_uint8_t recv_data[200]; + size_t size = tcpRec(recv_data); + LOG_HEX("tcpTT", 16, recv_data, size); + } + } +} +//INIT_COMPONENT_EXPORT(recTT_thread_entry); + +static void recTT(void) +{ + /* 创建 serial 线程 */ + rt_thread_t thread = rt_thread_create("recTT", recTT_thread_entry, RT_NULL, 1024 * 12, 27, 10); + /* 创建成功则启动线程 */ + if (thread != RT_NULL) + { + rt_thread_startup(thread); + } + else + { + LOG_E("thread 'recTT' create failure."); + return; + } +} + diff --git a/applications/uart_dma_sample.c b/applications/uart_dma_sample.c index e63135c..2d482a9 100644 --- a/applications/uart_dma_sample.c +++ b/applications/uart_dma_sample.c @@ -40,6 +40,21 @@ static rt_device_t serial; /* 消息队列控制块 */ static struct rt_messagequeue rx_mq; +/* 定时器的控制块 */ +static rt_timer_t timer1; + +/* 定时器1超时函数 */ +static void timeout1(void *parameter) +{ +// rt_kprintf("periodic timer is timeout %d\n", cnt); + + +// rt_timer_stop(timer1); + LOG_W("超时未收到新数据。"); + +} + + /* 接收数据回调函数 */ static rt_err_t uart_input(rt_device_t dev, rt_size_t size) { @@ -58,55 +73,63 @@ static rt_err_t uart_input(rt_device_t dev, rt_size_t size) } struct rx_msg msg; extern struct rt_event update_cfg; -//static char rx_buffer[RT_SERIAL_RB_BUFSZ + 1]; +extern int time2Str(char *str); + static void serial_thread_entry(void *parameter) { // struct rx_msg msg; rt_err_t result; - rt_uint32_t rx_length; + rt_uint32_t rx_length=0;//单次收到的数据长度 static char rx_buffer[RT_SERIAL_RB_BUFSZ + 1]; + static currLen=0;//已收数据长度 + static char f[30]; + time2Str(f); while (1) { -// rt_memset(&cfg, 0, sizeof(cfg)); +//暂定逻辑 +//先创建文件 +//接收数据并存盘 +// rt_memset(&msg, 0, sizeof(msg)); /* 从消息队列中读取消息*/ -// rt_uint32_t e; -// rt_err_t result = rt_event_recv(&update_cfg, CFGCHANGEED|MAXSIZEPERFILE, RT_EVENT_FLAG_OR|RT_EVENT_FLAG_CLEAR, RT_WAITING_NO, &e); -// if (result == RT_EOK) -// { -// LOG_I("updatecfg"); -// } result = rt_mq_recv(&rx_mq, &msg, sizeof(msg), RT_WAITING_FOREVER); + + + if (result == RT_EOK) { + /* 从串口读取数据*/ - rx_length = rt_device_read(msg.dev, 0, rx_buffer, msg.size); - rx_buffer[rx_length] = '\0'; - /* 通过串口设备 serial 输出读取到的消息 */ - rt_device_write(serial, 0, rx_buffer, rx_length); - int fd=0; + rx_length = rt_device_read(msg.dev, 0, rx_buffer+rx_length, msg.size); + currLen += rx_length; + /* 启动定时器1 */ + if (timer1 != RT_NULL) + rt_timer_start(timer1); - fd =open("/rxdata/demo.bin",O_WRONLY | O_CREAT|O_APPEND); - if(fd <0) - { - rt_kprintf("open file failed!\r\n"); - } - else - { - int count =write(fd,rx_buffer,rx_length); - close(fd); - fd =0; - } + LOG_HEX("rx:",16,rx_buffer,rx_length);//print what received. +#ifdef TR_ACK + /* 回传收到的消息 */ + rt_device_write(serial, 0, rx_buffer+rx_length, rx_length); +#endif + if (currLen > 1024) //大于1k则存盘 + { - /* 打印数据 */ - rt_kprintf("%s\n",rx_buffer); + int fd =open(f,O_WRONLY | O_CREAT|O_APPEND); + if(fd <0) + { + LOG_E("open file %s failed!", f); + } + else + { + write(fd,rx_buffer,rx_length); + close(fd); + currLen = 0; + rx_length=0; + } + } } - else { -// LOG_D("no data reced."); - } - rt_thread_mdelay(100); } } @@ -116,7 +139,7 @@ static int uart_dma_sample(int argc, char *argv[]) rt_err_t ret = RT_EOK; char uart_name[RT_NAME_MAX]; static char msg_pool[256]; - char str[] = "hello RT-Thread!\r\n"; +// char str[] = "hello RT-Thread!\r\n"; if (argc == 2) { @@ -147,7 +170,13 @@ static int uart_dma_sample(int argc, char *argv[]) /* 设置接收回调函数 */ rt_device_set_rx_indicate(serial, uart_input); /* 发送字符串 */ - rt_device_write(serial, 0, str, (sizeof(str) - 1)); +// rt_device_write(serial, 0, str, (sizeof(str) - 1)); + + /* 创建定时器1 周期定时器 */ + timer1 = rt_timer_create("rxtimer", timeout1, + RT_NULL, 10, + RT_TIMER_FLAG_PERIODIC); + /* 创建 serial 线程 */ rt_thread_t thread = rt_thread_create("serial", serial_thread_entry, RT_NULL, 1024*1, 25+1, 10); diff --git a/applications/usrcfg.h b/applications/usrcfg.h index 13d2080..0648a36 100644 --- a/applications/usrcfg.h +++ b/applications/usrcfg.h @@ -16,7 +16,8 @@ #define FILE_IS_OK 1 #define TIMER_IS_OUT 1<<1 #define TT_IS_OK 1<<2 - +#define TT_TCP_OK 1<<3 +#define TTIP "10.10.10.72" typedef struct { diff --git a/rtconfig.h b/rtconfig.h index 929bcf0..e113a74 100644 --- a/rtconfig.h +++ b/rtconfig.h @@ -49,7 +49,7 @@ #define RT_USING_DEVICE #define RT_USING_CONSOLE #define RT_CONSOLEBUF_SIZE 256 -#define RT_CONSOLE_DEVICE_NAME "uart3" +#define RT_CONSOLE_DEVICE_NAME "uart1" /* end of Kernel Device Object */ #define RT_VER_NUM 0x40101 /* end of RT-Thread Kernel */