feat: 新增激光定时关闭与姿态角持续输出测试功能,编码转UTF-8
1. 激光定时自动关闭:默认10分钟,laser on启动计时,超时自动关并上报 2. laser time <min>可配置定时分钟数,0=关闭定时 3. att on/off持续输出姿态角(Pitch/Roll/Yaw),不注册不低功耗 4. 20个源文件从GB2312编码转为UTF-8 with BOM
This commit is contained in:
+39
-37
@@ -1,12 +1,12 @@
|
||||
#ifndef __MAIN_H
|
||||
#ifndef __MAIN_H
|
||||
#define __MAIN_H
|
||||
#include "bsp.h"
|
||||
#include "UartDebug.h"
|
||||
#include "Update.h"
|
||||
#include "Imu.h"
|
||||
|
||||
#define SOFTWARE_VERSION 12 //软件版本
|
||||
#define HARDWARE_VERSION 11 //硬件版本
|
||||
#define SOFTWARE_VERSION 12 //软件版本
|
||||
#define HARDWARE_VERSION 11 //硬件版本
|
||||
|
||||
#define MAIN_DBG_LOG(...) { if(MainDispEn) DBG_LOG(__VA_ARGS__);}
|
||||
#define DATA_DBG_LOG(...) { if(DataDispEn) DBG_LOG(__VA_ARGS__);}
|
||||
@@ -17,34 +17,34 @@
|
||||
#define Z 2
|
||||
#define XYZ 3
|
||||
|
||||
#define SYSTEM_TIMING_LOGIN (86400 / 30) //系统定时注册时间(一天86400秒)
|
||||
#define ERR_TIMING_LOGIN (1800 / 30) //注册错误重新注册时间(半个小时1800秒)
|
||||
#define SYSTEM_TIMING_LOGIN (86400 / 30) //系统定时注册时间(一天86400秒)
|
||||
#define ERR_TIMING_LOGIN (1800 / 30) //注册错误重新注册时间(半个小时1800秒)
|
||||
|
||||
#define TEST_TIME (60*60*1000)
|
||||
|
||||
#define ERINTERVAL_VPT 10 //紧急上报阈值,单位0.1°
|
||||
#define ERINTERVAL_VPT 10 //紧急上报阈值,单位0.1°
|
||||
#define ERINTERVAL_VPT 10 //紧急上报阈值,单位0.1°
|
||||
#define ERINTERVAL_VPT 10 //紧急上报阈值,单位0.1°
|
||||
|
||||
typedef struct {//传感器原始数据
|
||||
typedef struct {//传感器原始数据
|
||||
float acce[XYZ];
|
||||
float gy[XYZ];
|
||||
float mag[XYZ];
|
||||
}__attribute__ ((packed))SensorData_T,*SensorDp;//传感器数据
|
||||
}__attribute__ ((packed))SensorData_T,*SensorDp;//传感器数据
|
||||
|
||||
typedef struct {//转换的数据
|
||||
int16_t Pitch; //俯仰角偏斜 (范围±900)单位0.1°
|
||||
int16_t Roll; //横滚角偏斜 (范围±900)单位0.1°
|
||||
int16_t Yaw; //偏航角偏斜 (范围0~3600)单位0.1°
|
||||
// int16_t Temp; //温度值
|
||||
// int32_t AD; //AD值
|
||||
typedef struct {//转换的数据
|
||||
int16_t Pitch; //俯仰角偏斜 (范围±900)单位0.1°
|
||||
int16_t Roll; //横滚角偏斜 (范围±900)单位0.1°
|
||||
int16_t Yaw; //偏航角偏斜 (范围0~3600)单位0.1°
|
||||
// int16_t Temp; //温度值
|
||||
// int32_t AD; //AD值
|
||||
}__attribute__ ((packed))ConvertedData_T, *ConvertedDp;
|
||||
|
||||
typedef struct {// 姿态角数据
|
||||
typedef struct {// 姿态角数据
|
||||
Rad_T Rad;
|
||||
Deg_T Deg;
|
||||
}__attribute__ ((packed))AHRSData_T,*AHRSDp;
|
||||
|
||||
/*主程序状态机*/
|
||||
/*主程序状态机*/
|
||||
typedef enum {
|
||||
APP_STATUS_IDLE,
|
||||
APP_STATUS_SLEEP,
|
||||
@@ -55,7 +55,7 @@ typedef enum {
|
||||
APP_STATUS_WAIT_UPLOAD,
|
||||
}AppStatus_m;
|
||||
|
||||
/*数据读取状态机*/
|
||||
/*数据读取状态机*/
|
||||
typedef enum {
|
||||
READDATA_STATUS_IDLE,
|
||||
READDATA_STATUS_UPDAING,
|
||||
@@ -64,8 +64,8 @@ typedef enum {
|
||||
}ReadDataStatus_m;
|
||||
|
||||
typedef struct {
|
||||
AppStatus_m Status;//状态
|
||||
ReadDataStatus_m RDStatus;//读取数据状态
|
||||
AppStatus_m Status;//状态
|
||||
ReadDataStatus_m RDStatus;//读取数据状态
|
||||
|
||||
uint32_t TD1mSDelayCnt;
|
||||
uint8_t FeedDogDlyCnt;
|
||||
@@ -77,30 +77,32 @@ typedef struct {
|
||||
AHRSData_T AHRSData;
|
||||
ConvertedData_T ConvertedData;
|
||||
|
||||
uint32_t RepeLoginCount; //24h重复注册计数
|
||||
uint8_t Login30MinCount; //注册30分定时计数
|
||||
uint8_t Login2Min30SCount; //注册100ms~2分+30s定时计数
|
||||
bool Login_RTC; //注册30分定时器启动标志位
|
||||
bool Login_LPTimer0; //注册100ms~2分+30s定时器启动标志位
|
||||
bool LoginFlag; //注册标志位
|
||||
uint32_t RepeLoginCount; //24h重复注册计数
|
||||
uint8_t Login30MinCount; //注册30分定时计数
|
||||
uint8_t Login2Min30SCount; //注册100ms~2分+30s定时计数
|
||||
bool Login_RTC; //注册30分定时器启动标志位
|
||||
bool Login_LPTimer0; //注册100ms~2分+30s定时器启动标志位
|
||||
bool LoginFlag; //注册标志位
|
||||
|
||||
uint16_t Coll_N; //数据采集时间计数
|
||||
uint16_t Repor_N; //上报时间计数
|
||||
uint16_t ERInterval_N; //紧急上报时间间隔计数
|
||||
uint8_t ERTime_N; //紧急上报时间计数
|
||||
bool ERFlag; //紧急上报标志位
|
||||
uint16_t Coll_N; //数据采集时间计数
|
||||
uint16_t Repor_N; //上报时间计数
|
||||
uint16_t ERInterval_N; //紧急上报时间间隔计数
|
||||
uint8_t ERTime_N; //紧急上报时间计数
|
||||
bool ERFlag; //紧急上报标志位
|
||||
|
||||
bool UploadFlag; //上传数据标志位
|
||||
uint8_t Upload45S10SCount; //上传数据超时计数
|
||||
bool Upload_LPTimer0; //上传100~10000ms+45秒定时器启动标志位
|
||||
bool UploadFlag; //上传数据标志位
|
||||
uint8_t Upload45S10SCount; //上传数据超时计数
|
||||
bool Upload_LPTimer0; //上传100~10000ms+45秒定时器启动标志位
|
||||
|
||||
bool MagRead_EndFlag;
|
||||
bool AccRead_EndFlag;
|
||||
bool UpdateOk; //数据更新标志位
|
||||
bool UpdateOk; //数据更新标志位
|
||||
|
||||
bool CaliFlag; //标校标志位
|
||||
bool CaliFlag; //标校标志位
|
||||
|
||||
uint16_t Nonce; //随机数
|
||||
uint16_t Nonce; //随机数
|
||||
bool AttTestMode; //姿态测试模式标志位
|
||||
uint32_t AttTestCnt; //姿态测试打印计数(ms)
|
||||
}AppDetect_t;
|
||||
extern AppDetect_t App;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user