feat: 新增全功率运行时间段(FPO)功能

- bsp.h: LayoutPara_t 新增 FPOTimeStart/FPOTime 字段, 移除BOM, 声明TimeGet
- main.h: 声明 IsFullPowerTime
- main.c: 新增 IsFullPowerTime() 判断函数(支持跨天), 睡眠条件加FPO检查, AppInit中FPO参数初始化与校验
- SGCP.h: 新增 GWTOMD_CMD_SET_FPO=0x0A, GW_STATUS_SET_FPO 枚举, 声明 ToGWSetFPORes
- SGCP.c: 实现 ToGWSetFPORes() 回应帧, GWTOMD_CMD_SET_FPO 接收处理(校验/存Flash), 两个GwRevLoopHandler新增GW_STATUS_SET_FPO case
- UartDebug.c: 新增 fpocfg 调试命令(配置后向网关发送0x0A通知), para输出FPO信息, DEBUG_CMD_CNT 17->18
- bsp.c: TimeGet 去除UTC+8偏移(RTC已存本地时间)
This commit is contained in:
2026-08-17 10:36:33 +08:00
parent 0f8bed829e
commit f239690002
8 changed files with 262 additions and 34 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
#ifndef _BSP_H
#ifndef _BSP_H
#define _BSP_H
#include <stdint.h>
@@ -225,6 +225,8 @@ typedef struct {
uint16_t ReportInterval; //上报时间间隔,设置范围,30*N秒,10<=N<=1440(默认1200秒,N=40
uint8_t ERInterval; //紧急上报时间间隔,设置范围,30*N秒,2<=N<=10(默认120秒,N=4
uint8_t ERTime; //紧急上报时长,设置范围,30*N秒,20<=N<=240(默认1200秒,N=40
uint8_t FPOTimeStart; //每天全功率工作时间起始点时间,设置范围0~23小时整点时间(默认0点整)
uint8_t FPOTime; //每天全功率工作时间时长,设置范围0~24小时(默认0小时)
uint32_t TimeStamp; //网关返回RTC时间戳
}__attribute__((packed))LayoutPara_t,*LayoutPara;//上位机下发的配置参数
@@ -279,6 +281,7 @@ uint32_t GetSysTick(void);
void delay_ms(uint32_t ms);
void Delay(uint32_t time);
void RTCInit(uint8_t sec);
void TimeGet(struct tm *cTime);
void LPTimer0_ON(uint16_t _100ms);
void LPTimer0_OFF(void);
void WakeUpInit(void);