v1.5 基本完成功能,待测试
This commit is contained in:
parent
a8853d57b5
commit
40c903ca57
@ -271,7 +271,7 @@ void add(int argc, char **argv)
|
||||
}
|
||||
|
||||
MSH_CMD_EXPORT(gf, 查看待发送文件列表)
|
||||
MSH_CMD_EXPORT_ALIAS(add, cf,查看待发送文件列表)
|
||||
//MSH_CMD_EXPORT_ALIAS(add, cf,查看待发送文件列表)
|
||||
|
||||
//set_if()
|
||||
#endif
|
||||
|
@ -49,7 +49,7 @@ typedef struct
|
||||
// char *ele; // 高度
|
||||
}TT;
|
||||
|
||||
TT tmp={.sim="-",.xh="-",.jh="-",.jd=":0.000000",.wd=":0.000000",.ele=":0.000000"};
|
||||
TT tmp={.sim="-",.xh="-",.jh="-",.jd="-",.wd="-",.ele="-"};
|
||||
//memset(&tmp,0x00,sizeof(TT));
|
||||
TT *TTinfo=&tmp;
|
||||
static rt_tick_t bootstamp=0;
|
||||
@ -163,7 +163,7 @@ static void rulecheck(void)
|
||||
// rt_event_send(&sw_check, TT_IS_OK);
|
||||
upTTflag();
|
||||
upTTflagtmp();
|
||||
LOG_D("符合规则,TT具备发送状态。");
|
||||
LOG_I("符合规则,TT具备发送状态。");
|
||||
// updateSta();
|
||||
okCnt = minTTPeriCnt -1;
|
||||
}
|
||||
@ -298,29 +298,29 @@ void getTTinfo_thread_entry(void* parameter)
|
||||
rt_kprintf("%5s%5s%5s%5s%15s%15s%10s\n", "SIM", "xh", "rw", "jh", "N", "E", "ele");
|
||||
for (i = 0; i < cfg->cnt; ++i) //按指定次数轮询
|
||||
{
|
||||
for (var = 0; var < isize; var++) //轮询每个参数
|
||||
{
|
||||
static char *url = RT_NULL;
|
||||
url = web_strdup(*(infoH + var));
|
||||
if (url == RT_NULL)
|
||||
{
|
||||
LOG_E("no memory for create getTT url buffer.\n");
|
||||
// return -RT_ENOMEM;
|
||||
}
|
||||
if (webclient_get_data(url) != RT_EOK)
|
||||
{
|
||||
strcpy(TTinfo->sim,"-");
|
||||
strcpy(TTinfo->xh,"-");
|
||||
strcpy(TTinfo->jh,"-");
|
||||
strcpy(TTinfo->jd,"-");
|
||||
strcpy(TTinfo->wd,"-");
|
||||
strcpy(TTinfo->ele,"-");
|
||||
break;
|
||||
}
|
||||
web_free(url);
|
||||
rt_thread_mdelay(100);
|
||||
}
|
||||
rulecheck();
|
||||
// for (var = 0; var < isize; var++) //轮询每个参数
|
||||
// {
|
||||
// static char *url = RT_NULL;
|
||||
// url = web_strdup(*(infoH + var));
|
||||
// if (url == RT_NULL)
|
||||
// {
|
||||
// LOG_E("no memory for create getTT url buffer.\n");
|
||||
//// return -RT_ENOMEM;
|
||||
// }
|
||||
// if (webclient_get_data(url) != RT_EOK)
|
||||
// {
|
||||
// strcpy(TTinfo->sim,"-");
|
||||
// strcpy(TTinfo->xh,"-");
|
||||
// strcpy(TTinfo->jh,"-");
|
||||
// strcpy(TTinfo->jd,"-");
|
||||
// strcpy(TTinfo->wd,"-");
|
||||
// strcpy(TTinfo->ele,"-");
|
||||
// break;
|
||||
// }
|
||||
// web_free(url);
|
||||
// rt_thread_mdelay(100);
|
||||
// }
|
||||
// rulecheck();
|
||||
rt_kprintf("%5s%5s%5s%5s%15s%15s%10s\n", TTinfo->sim, TTinfo->xh, TTinfo->rw, TTinfo->jh, TTinfo->jd,
|
||||
TTinfo->wd, TTinfo->ele);
|
||||
if (i != cfg->cnt - 1) //最后一次采集不延时
|
||||
@ -410,7 +410,10 @@ void repGetTT_thread_entry(void* parameter)
|
||||
}
|
||||
}
|
||||
|
||||
void repGetTT()
|
||||
/**
|
||||
* 持续更新TT状态信息,数据3s刷新一次。TT断电后退出。
|
||||
*/
|
||||
void repGetTT(void)
|
||||
{
|
||||
/* 创建 serial 线程 */
|
||||
rt_thread_t thread = rt_thread_create("repGetTT", repGetTT_thread_entry, RT_NULL, 1024 * 3, 25, 10);
|
||||
|
@ -118,3 +118,11 @@ void pp(int argc, char **argv)
|
||||
MSH_CMD_EXPORT(pp, 打包文件。);
|
||||
extern int rt_hw_stm32_eth_init(void);
|
||||
MSH_CMD_EXPORT(rt_hw_stm32_eth_init, 初始化网络。);
|
||||
|
||||
void show_version(void)
|
||||
{
|
||||
rt_kprintf("SW Version: %s\n","1.5(temp)");
|
||||
}
|
||||
|
||||
MSH_CMD_EXPORT(show_version,显示版本号);
|
||||
INIT_COMPONENT_EXPORT(show_version);
|
||||
|
@ -90,7 +90,6 @@ void repeatSend_thread_entry()
|
||||
if (timer1 != RT_NULL)
|
||||
rt_timer_start(timer1);
|
||||
|
||||
// rt_err_t result = rt_event_init(&readyToSend, "readyToSend", RT_IPC_FLAG_PRIO);
|
||||
/* 创建 serial 线程 */
|
||||
rt_thread_t thread = rt_thread_create("repsendT", repeatSend_thread_entry, RT_NULL, 1024*3, 25+1, 10);
|
||||
/* 创建成功则启动线程 */
|
||||
@ -107,9 +106,11 @@ void repeatSend_thread_entry()
|
||||
void inievt()
|
||||
{
|
||||
|
||||
pwTT_thread_entry("1");
|
||||
pwTT_thread_entry("1");//开机
|
||||
rt_err_t result = rt_event_init(&readyToSend, "repSend", RT_IPC_FLAG_PRIO);
|
||||
rt_hw_stm32_eth_init();//激活网口
|
||||
rt_thread_mdelay(10*1000);
|
||||
repGetTT();//持续更新
|
||||
}
|
||||
INIT_APP_EXPORT(inievt);
|
||||
INIT_APP_EXPORT(timer_demo);
|
||||
|
@ -513,7 +513,7 @@ MSH_CMD_EXPORT(pmsg, 打包文件。);
|
||||
|
||||
/**
|
||||
* 天通上电
|
||||
* @param parameter
|
||||
* @param parameter "0"断电,其它上电
|
||||
*/
|
||||
void pwTT_thread_entry(void *parameter)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
int rt_hw_spi_flash_init(void)
|
||||
{
|
||||
rt_kprintf("SW Version: %s\n","1.3(temp)");
|
||||
// rt_kprintf("SW Version: %s\n","1.4(temp)");
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
// __HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
// rt_kprintf("sfud success.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user