降低了掉电阈值,以及修改了联网机制,只要事件触发,则断网重连标志清空
This commit is contained in:
parent
0ffa92c2c1
commit
ceaa0578c6
|
@ -5,7 +5,7 @@
|
|||
"type": "mrs-debugger",
|
||||
"request": "launch",
|
||||
"name": "ble_bjq_ch303rct6_ml307",
|
||||
"cwd": "c:\\Users\\16586\\Desktop\\ble_-tyq_-bjq_-ch32-v303",
|
||||
"cwd": "d:\\SXDT\\Project\\CH32\\ble_bjq_ch303rct6_ml307",
|
||||
"openOCDCfg": {
|
||||
"useLocalOpenOCD": true,
|
||||
"executable": "c:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/openocd.exe",
|
||||
|
@ -39,8 +39,8 @@
|
|||
"additionalCommands": []
|
||||
},
|
||||
"loadedFiles": {
|
||||
"executableFile": "c:\\Users\\16586\\Desktop\\ble_-tyq_-bjq_-ch32-v303\\obj\\ble_bjq_ch303rct6_ml307.elf",
|
||||
"symbolFile": "c:\\Users\\16586\\Desktop\\ble_-tyq_-bjq_-ch32-v303\\obj\\ble_bjq_ch303rct6_ml307.elf",
|
||||
"executableFile": "d:\\SXDT\\Project\\CH32\\ble_bjq_ch303rct6_ml307\\obj\\ble_bjq_ch303rct6_ml307.elf",
|
||||
"symbolFile": "d:\\SXDT\\Project\\CH32\\ble_bjq_ch303rct6_ml307\\obj\\ble_bjq_ch303rct6_ml307.elf",
|
||||
"executableFileOffset": 0,
|
||||
"symbolFileOffset": 0
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @Author: mbw
|
||||
* @Date: 2024-10-23 17:14:16
|
||||
* @LastEditors: mbw && 1600520629@qq.com
|
||||
* @LastEditTime: 2025-06-04 08:54:13
|
||||
* @LastEditTime: 2025-06-05 09:58:33
|
||||
* @FilePath: \ble_bjq_ch303rct6_ml307\applications\main.c
|
||||
* @Descrt_thread_
|
||||
*
|
||||
|
@ -198,7 +198,7 @@ uint16_t Get_Stable_Reading(uint8_t cnt, uint32_t timeout_ms)
|
|||
/*标定函数*/
|
||||
int APP_Calibration_Handle(void)
|
||||
{
|
||||
uint32_t gas_calibration_voltage = 0;
|
||||
uint16_t gas_calibration_voltage = 0;
|
||||
|
||||
// if (Get_Gas_VoltageAdcInt1000x() > 400 && Get_Gas_VoltageAdcInt1000x() < 900)
|
||||
// {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
// (4.7/19.7) * 13V = 3.1V, 3.1/3.3*4096 = 3723
|
||||
#define VIN_ADC_HIGH_THRESHOLD (uint16_t)3847 // 13V
|
||||
// (4.7/19.7) * 10V = 2.39V, 2.39/3.3*4096 = 2966
|
||||
#define VIN_ADC_LOW_THRESHOLD (uint16_t)2966 // 10V
|
||||
#define VIN_ADC_LOW_THRESHOLD (uint16_t)2665 // 9V
|
||||
|
||||
|
||||
float Get_VIN_Voltage(void);
|
||||
|
|
|
@ -975,6 +975,7 @@ int Ml307_Process_Events (Ml307Event ml307_recv_event, struct at_device *device,
|
|||
if (event) // 处理该事件
|
||||
{
|
||||
// 打印事件的名称
|
||||
ml307_disconnect_retry_flag = 0;//有事件,则断连重试标志清空
|
||||
ml307_current_evnet = event->event_flag;
|
||||
for (size_t i = 0; i < max_retry_count; i++)
|
||||
{
|
||||
|
@ -2181,11 +2182,12 @@ __exit:
|
|||
rt_thread_mdelay (retry_delay);
|
||||
retry_delay = MIN (retry_delay * 2, 1800000); // 最大延迟30min
|
||||
delay_n++;
|
||||
if (delay_n >= 21) // 连续重连大于1小时都不行,则重启设备
|
||||
if (delay_n >= 10) // 连续重连大于10都不行,则复位重连时间
|
||||
{
|
||||
Flash_Set_WorkDuration (work_duration);
|
||||
rt_thread_mdelay (100);
|
||||
reboot();
|
||||
// Flash_Set_WorkDuration (work_duration);
|
||||
// rt_thread_mdelay (100);
|
||||
// reboot();
|
||||
retry_delay = 8000;
|
||||
}
|
||||
ml307_conncet_tcp_flag = 0;
|
||||
rt_sem_release (ml307_disconnect_sem);
|
||||
|
|
Loading…
Reference in New Issue