#include "system_monitor.h" #include // 静态变量 static SystemMonitorStats_t g_system_stats = {0}; /** * @brief 初始化系统监控模块 * @param None * @retval None */ void SystemMonitor_Init(void) { memset(&g_system_stats, 0, sizeof(SystemMonitorStats_t)); } /** * @brief 增加采样样点计数 * @param None * @retval None */ void SystemMonitor_IncrementSampleCount(void) { g_system_stats.total_samples++; } /** * @brief 报告数据处理溢出(数据来不及处理) * @param None * @retval None */ void SystemMonitor_ReportDataOverflow(void) { g_system_stats.data_overflow_count++; } /** * @brief 获取系统统计信息 * @param stats: 统计信息结构体指针 * @retval None */ void SystemMonitor_GetStats(SystemMonitorStats_t *stats) { if (stats != NULL) { memcpy(stats, &g_system_stats, sizeof(SystemMonitorStats_t)); } }