<MiscControls></MiscControls>
<Define>USE_HAL_DRIVER,STM32H730xx,BOOTLOADER</Define>
<Undefine></Undefine>
- <IncludePath>../Core/Inc;../USB_DEVICE/App;../USB_DEVICE/Target;../Drivers/STM32H7xx_HAL_Driver/Inc;../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Middlewares/ST/STM32_USB_Device_Library/Core/Inc;../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc;../Drivers/CMSIS/Device/ST/STM32H7xx/Include;../Drivers/CMSIS/Include;../LWIP/App;../LWIP/Target;../Middlewares/Third_Party/LwIP/src/include;../Middlewares/Third_Party/LwIP/system;../Drivers/BSP/Components/lan8742;../Middlewares/Third_Party/LwIP/src/include/netif/ppp;../Middlewares/Third_Party/LwIP/src/include/lwip;../Middlewares/Third_Party/LwIP/src/include/lwip/apps;../Middlewares/Third_Party/LwIP/src/include/lwip/priv;../Middlewares/Third_Party/LwIP/src/include/lwip/prot;../Middlewares/Third_Party/LwIP/src/include/netif;../Middlewares/Third_Party/LwIP/src/include/compat/posix;../Middlewares/Third_Party/LwIP/src/include/compat/posix/arpa;../Middlewares/Third_Party/LwIP/src/include/compat/posix/net;../Middlewares/Third_Party/LwIP/src/include/compat/posix/sys;../Middlewares/Third_Party/LwIP/src/include/compat/stdc;../Middlewares/Third_Party/LwIP/system/arch;../lib</IncludePath>
+ <IncludePath>../Core/Inc;../USB_DEVICE/App;../USB_DEVICE/Target;../Drivers/STM32H7xx_HAL_Driver/Inc;../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Middlewares/ST/STM32_USB_Device_Library/Core/Inc;../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc;../Drivers/CMSIS/Device/ST/STM32H7xx/Include;../Drivers/CMSIS/Include;../LWIP/App;../LWIP/Target;../Middlewares/Third_Party/LwIP/src/include;../Middlewares/Third_Party/LwIP/system;../Drivers/BSP/Components/lan8742;../Middlewares/Third_Party/LwIP/src/include/netif/ppp;../Middlewares/Third_Party/LwIP/src/include/lwip;../Middlewares/Third_Party/LwIP/src/include/lwip/apps;../Middlewares/Third_Party/LwIP/src/include/lwip/priv;../Middlewares/Third_Party/LwIP/src/include/lwip/prot;../Middlewares/Third_Party/LwIP/src/include/netif;../Middlewares/Third_Party/LwIP/src/include/compat/posix;../Middlewares/Third_Party/LwIP/src/include/compat/posix/arpa;../Middlewares/Third_Party/LwIP/src/include/compat/posix/net;../Middlewares/Third_Party/LwIP/src/include/compat/posix/sys;../Middlewares/Third_Party/LwIP/src/include/compat/stdc;../Middlewares/Third_Party/LwIP/system/arch;../lib;..\user</IncludePath>
</VariousControls>
</Cads>
<Aads>
extern void user_rtc_init( void );
extern uint32_t hw_ver_read( void );
+static void device_poweron_total_time_update( uint32_t secs );
+
+
void StartDefaultTask(void *argument)
{
EventBits_t uxBits;
dev_cfg_v2_load(&g_dev.cfg2);
lfs_load_device_serial(g_dev.serial_number, sizeof(g_dev.serial_number));
g_dev.offline_secs = lfs_load_offline_time();
+ g_dev.all_time_total = lfs_load_all_time();
g_dev.hw_ver = hw_ver_read();
HAL_IWDG_Refresh( &hiwdg1 ); //4s iwdg
flow_total_update( 1000 ); //软件计算累计流量
+ device_poweron_total_time_update(1); //开机总时长更新
+
#if 1 //离线锁定检查,
//g_dev.cfg2.offline_max_time, 0:离线不锁定,大于0允许离线时间,到达时间自动锁定。
time_t now = time(NULL);
return HW_V3;
}
}
+
+void device_poweron_total_time_update( uint32_t secs ){
+ static int n = 0;
+ static int welding = 0;
+ n++;
+ g_dev.all_time_total += secs;
+ if( n>=60 ){
+ //60秒保存一次
+ n = 0;
+ lfs_store_all_time(g_dev.all_time_total);
+ }else if( welding != g_dev.welding_start ){
+ welding = g_dev.welding_start;
+ //焊接开始和停止时也保存
+ n = 0;
+ lfs_store_all_time(g_dev.all_time_total);
+ }
+}
\ No newline at end of file
else
rpt->gas = 1;
}
-
+
rpt->weld_time = g_dev.welding_time_total/1000;
#if 1
/*
rpt->alarm = 0;
}
#endif
- rpt->on_time = 0;
-
+ rpt->on_time = g_dev.all_time_total;
if( memcmp( rpt, &g_rpt_sent, sizeof( g_rpt_sent ) ) ){
rpt->cid++;
}
extern void welding_data_store( uint16_t index ); //记录焊接数据
-
+extern int32_t is_curr_valid( float curr );
//static uint64_t g_welding_time_total = 0;
//static uint64_t g_time_total = 0;
//200毫秒扫描一次, 考虑pid的流量计反馈,让扫描周期大于流量计的采集周期,
vTaskDelayUntil(&last_tick, 100 );
welding_current = g_dev.welding_current;
-
+ if( !is_curr_valid( welding_current ) )
+ welding_current = 0;
// g_time_total += 100;
//
// static int i = 0;