v1.5 基本完成功能,待测试

This commit is contained in:
CSSC-WORK\murmur 2023-06-18 09:34:09 +08:00
parent a8853d57b5
commit 40c903ca57
6 changed files with 43 additions and 31 deletions

View File

@ -271,7 +271,7 @@ void add(int argc, char **argv)
} }
MSH_CMD_EXPORT(gf, ) MSH_CMD_EXPORT(gf, )
MSH_CMD_EXPORT_ALIAS(add, cf,) //MSH_CMD_EXPORT_ALIAS(add, cf,查看待发送文件列表)
//set_if() //set_if()
#endif #endif

View File

@ -49,7 +49,7 @@ typedef struct
// char *ele; // 高度 // char *ele; // 高度
}TT; }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)); //memset(&tmp,0x00,sizeof(TT));
TT *TTinfo=&tmp; TT *TTinfo=&tmp;
static rt_tick_t bootstamp=0; static rt_tick_t bootstamp=0;
@ -163,7 +163,7 @@ static void rulecheck(void)
// rt_event_send(&sw_check, TT_IS_OK); // rt_event_send(&sw_check, TT_IS_OK);
upTTflag(); upTTflag();
upTTflagtmp(); upTTflagtmp();
LOG_D("符合规则TT具备发送状态。"); LOG_I("符合规则TT具备发送状态。");
// updateSta(); // updateSta();
okCnt = minTTPeriCnt -1; 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"); 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 (i = 0; i < cfg->cnt; ++i) //按指定次数轮询
{ {
for (var = 0; var < isize; var++) //轮询每个参数 // for (var = 0; var < isize; var++) //轮询每个参数
{ // {
static char *url = RT_NULL; // static char *url = RT_NULL;
url = web_strdup(*(infoH + var)); // url = web_strdup(*(infoH + var));
if (url == RT_NULL) // if (url == RT_NULL)
{ // {
LOG_E("no memory for create getTT url buffer.\n"); // LOG_E("no memory for create getTT url buffer.\n");
// return -RT_ENOMEM; //// return -RT_ENOMEM;
} // }
if (webclient_get_data(url) != RT_EOK) // if (webclient_get_data(url) != RT_EOK)
{ // {
strcpy(TTinfo->sim,"-"); // strcpy(TTinfo->sim,"-");
strcpy(TTinfo->xh,"-"); // strcpy(TTinfo->xh,"-");
strcpy(TTinfo->jh,"-"); // strcpy(TTinfo->jh,"-");
strcpy(TTinfo->jd,"-"); // strcpy(TTinfo->jd,"-");
strcpy(TTinfo->wd,"-"); // strcpy(TTinfo->wd,"-");
strcpy(TTinfo->ele,"-"); // strcpy(TTinfo->ele,"-");
break; // break;
} // }
web_free(url); // web_free(url);
rt_thread_mdelay(100); // rt_thread_mdelay(100);
} // }
rulecheck(); // rulecheck();
rt_kprintf("%5s%5s%5s%5s%15s%15s%10s\n", TTinfo->sim, TTinfo->xh, TTinfo->rw, TTinfo->jh, TTinfo->jd, rt_kprintf("%5s%5s%5s%5s%15s%15s%10s\n", TTinfo->sim, TTinfo->xh, TTinfo->rw, TTinfo->jh, TTinfo->jd,
TTinfo->wd, TTinfo->ele); TTinfo->wd, TTinfo->ele);
if (i != cfg->cnt - 1) //最后一次采集不延时 if (i != cfg->cnt - 1) //最后一次采集不延时
@ -410,7 +410,10 @@ void repGetTT_thread_entry(void* parameter)
} }
} }
void repGetTT() /**
* TT状态信息3s刷新一次TT断电后退出
*/
void repGetTT(void)
{ {
/* 创建 serial 线程 */ /* 创建 serial 线程 */
rt_thread_t thread = rt_thread_create("repGetTT", repGetTT_thread_entry, RT_NULL, 1024 * 3, 25, 10); rt_thread_t thread = rt_thread_create("repGetTT", repGetTT_thread_entry, RT_NULL, 1024 * 3, 25, 10);

View File

@ -118,3 +118,11 @@ void pp(int argc, char **argv)
MSH_CMD_EXPORT(pp, ); MSH_CMD_EXPORT(pp, );
extern int rt_hw_stm32_eth_init(void); extern int rt_hw_stm32_eth_init(void);
MSH_CMD_EXPORT(rt_hw_stm32_eth_init, ); 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);

View File

@ -90,7 +90,6 @@ void repeatSend_thread_entry()
if (timer1 != RT_NULL) if (timer1 != RT_NULL)
rt_timer_start(timer1); rt_timer_start(timer1);
// rt_err_t result = rt_event_init(&readyToSend, "readyToSend", RT_IPC_FLAG_PRIO);
/* 创建 serial 线程 */ /* 创建 serial 线程 */
rt_thread_t thread = rt_thread_create("repsendT", repeatSend_thread_entry, RT_NULL, 1024*3, 25+1, 10); 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() void inievt()
{ {
pwTT_thread_entry("1"); pwTT_thread_entry("1");//开机
rt_err_t result = rt_event_init(&readyToSend, "repSend", RT_IPC_FLAG_PRIO); rt_err_t result = rt_event_init(&readyToSend, "repSend", RT_IPC_FLAG_PRIO);
rt_hw_stm32_eth_init();//激活网口 rt_hw_stm32_eth_init();//激活网口
rt_thread_mdelay(10*1000);
repGetTT();//持续更新
} }
INIT_APP_EXPORT(inievt); INIT_APP_EXPORT(inievt);
INIT_APP_EXPORT(timer_demo); INIT_APP_EXPORT(timer_demo);

View File

@ -513,7 +513,7 @@ MSH_CMD_EXPORT(pmsg, 打包文件。);
/** /**
* *
* @param parameter * @param parameter "0"
*/ */
void pwTT_thread_entry(void *parameter) void pwTT_thread_entry(void *parameter)
{ {

View File

@ -23,7 +23,7 @@
int rt_hw_spi_flash_init(void) 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_GPIOB_CLK_ENABLE();
// __HAL_RCC_GPIOD_CLK_ENABLE(); // __HAL_RCC_GPIOD_CLK_ENABLE();
// rt_kprintf("sfud success.\n"); // rt_kprintf("sfud success.\n");