对报的定时器超出值再加了一层限幅处理
This commit is contained in:
parent
5312f3cb0f
commit
a7602b3042
|
@ -5,7 +5,7 @@
|
||||||
"type": "mrs-debugger",
|
"type": "mrs-debugger",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "JT-DT-YD4N02A_RTT_MRS-4G",
|
"name": "JT-DT-YD4N02A_RTT_MRS-4G",
|
||||||
"cwd": "d:\\SXDT\\Project\\CH32\\JT-DT-YD4N02A_RTT_MRS-NT26K",
|
"cwd": "c:\\Users\\张喆1223\\Desktop\\NT26K\\JT-DT-YD4N02A_4G_RTT_MRS",
|
||||||
"openOCDCfg": {
|
"openOCDCfg": {
|
||||||
"useLocalOpenOCD": true,
|
"useLocalOpenOCD": true,
|
||||||
"executable": "c:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/openocd.exe",
|
"executable": "c:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/openocd.exe",
|
||||||
|
@ -39,8 +39,8 @@
|
||||||
"additionalCommands": []
|
"additionalCommands": []
|
||||||
},
|
},
|
||||||
"loadedFiles": {
|
"loadedFiles": {
|
||||||
"executableFile": "d:\\SXDT\\Project\\CH32\\JT-DT-YD4N02A_RTT_MRS-NT26K\\obj\\JT-DT-YD4N02A_RTT_MRS-4G.elf",
|
"executableFile": "c:\\Users\\张喆1223\\Desktop\\NT26K\\JT-DT-YD4N02A_4G_RTT_MRS\\obj\\JT-DT-YD4N02A_RTT_MRS-4G.elf",
|
||||||
"symbolFile": "d:\\SXDT\\Project\\CH32\\JT-DT-YD4N02A_RTT_MRS-NT26K\\obj\\JT-DT-YD4N02A_RTT_MRS-4G.elf",
|
"symbolFile": "c:\\Users\\张喆1223\\Desktop\\NT26K\\JT-DT-YD4N02A_4G_RTT_MRS\\obj\\JT-DT-YD4N02A_RTT_MRS-4G.elf",
|
||||||
"executableFileOffset": 0,
|
"executableFileOffset": 0,
|
||||||
"symbolFileOffset": 0
|
"symbolFileOffset": 0
|
||||||
},
|
},
|
||||||
|
|
|
@ -382,7 +382,6 @@ int at_send_data(struct at_device *device, const char *data, rt_size_t size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
at_delete_resp(resp);
|
at_delete_resp(resp);
|
||||||
return -RT_ERROR;
|
return -RT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ struct rt_event at_device_event;
|
||||||
rt_sem_t nt26k_recv_sem;
|
rt_sem_t nt26k_recv_sem;
|
||||||
rt_sem_t nt26k_recv_msg_sem; // 用于接收信号
|
rt_sem_t nt26k_recv_msg_sem; // 用于接收信号
|
||||||
rt_sem_t nt26k_disconnect_sem;
|
rt_sem_t nt26k_disconnect_sem;
|
||||||
|
|
||||||
static rt_timer_t nt26k_timer; // 上报心跳
|
static rt_timer_t nt26k_timer; // 上报心跳
|
||||||
static rt_timer_t nt26k_upload_timer; // 更新本地时间定时器
|
static rt_timer_t nt26k_upload_timer; // 更新本地时间定时器
|
||||||
static rt_timer_t nt26k_error_timer; // 上电失败情况下启动定时器
|
static rt_timer_t nt26k_error_timer; // 上电失败情况下启动定时器
|
||||||
|
@ -1580,6 +1581,10 @@ int BSP_Nt26k_Thread_Init(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
timeout = iot_upload_time * 60 * RT_TICK_PER_SECOND;
|
timeout = iot_upload_time * 60 * RT_TICK_PER_SECOND;
|
||||||
|
if (timeout >= RT_TICK_MAX / 2)//超了就直接默认值
|
||||||
|
{
|
||||||
|
timeout = 60 * 60 * RT_TICK_PER_SECOND;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I("上报服务器周期:%d分钟", iot_upload_time);
|
LOG_I("上报服务器周期:%d分钟", iot_upload_time);
|
||||||
|
|
Loading…
Reference in New Issue