添加启动时间记录,更改硬件短路保护事件记录错误
This commit is contained in:
parent
3a36df469e
commit
af04d91130
|
@ -7,7 +7,7 @@
|
||||||
#include "parameter.h"
|
#include "parameter.h"
|
||||||
#include "FM_TIM.h"
|
#include "FM_TIM.h"
|
||||||
#include "inFlash.h"
|
#include "inFlash.h"
|
||||||
|
#include "SOE.h"
|
||||||
|
|
||||||
void startInfo(void)
|
void startInfo(void)
|
||||||
{
|
{
|
||||||
|
@ -68,6 +68,8 @@ void start(void)
|
||||||
// cfgTest();
|
// cfgTest();
|
||||||
// HAL_Delay(1000);
|
// HAL_Delay(1000);
|
||||||
// }
|
// }
|
||||||
|
/* 启动事件 */
|
||||||
|
insertEventsOrderRecord(startEvent);
|
||||||
|
|
||||||
TimeSliceOffset_Start();
|
TimeSliceOffset_Start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,6 +141,10 @@ void insertEventsOrderRecord(eventsOrderRecordMode mode)
|
||||||
soeInfo.insertData->temp = get_EXCHG_CURR();
|
soeInfo.insertData->temp = get_EXCHG_CURR();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (mode == startEvent) {
|
||||||
|
soeInfo.insertData->temp = 0;
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
soeInfo.count++;
|
soeInfo.count++;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -402,7 +402,7 @@ void checkAbnormal(void)
|
||||||
// checkTimeInit();
|
// checkTimeInit();
|
||||||
/* 滤波 */
|
/* 滤波 */
|
||||||
adcCaptureFir();
|
adcCaptureFir();
|
||||||
|
|
||||||
/* 转换 */
|
/* 转换 */
|
||||||
setChargCurrent();
|
setChargCurrent();
|
||||||
setDischargCurrent();
|
setDischargCurrent();
|
||||||
|
@ -416,7 +416,7 @@ void checkAbnormal(void)
|
||||||
lowInputLoadDetection();
|
lowInputLoadDetection();
|
||||||
judgeChargCurr();
|
judgeChargCurr();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// checkAbnormalTime = getCheckTime();
|
// checkAbnormalTime = getCheckTime();
|
||||||
}
|
}
|
||||||
|
@ -455,7 +455,6 @@ void DSG_PROT_Interrupt(void)
|
||||||
setShortCircuit();
|
setShortCircuit();
|
||||||
/* 第一次进入输出短路,启动短路任务 */
|
/* 第一次进入输出短路,启动短路任务 */
|
||||||
if (getShortCircuit() == 1) {
|
if (getShortCircuit() == 1) {
|
||||||
setPowerOutput(FALSE);
|
|
||||||
setShortCircuitFlag(TRUE);
|
setShortCircuitFlag(TRUE);
|
||||||
startShortCircuitProtection();
|
startShortCircuitProtection();
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,7 +275,7 @@ void Task_wdi(void)
|
||||||
timeInfo time;
|
timeInfo time;
|
||||||
time = getLastTime();
|
time = getLastTime();
|
||||||
saveTime(&time);
|
saveTime(&time);
|
||||||
NVIC_SystemReset();
|
// NVIC_SystemReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -680,6 +680,13 @@ void Task_shortCircuitProtection(void)
|
||||||
static uint8_t num = 0;
|
static uint8_t num = 0;
|
||||||
num++;
|
num++;
|
||||||
|
|
||||||
|
/* 设定输出短路保护时间 */
|
||||||
|
if (num == 2) {
|
||||||
|
setPowerOutput(FALSE);
|
||||||
|
setPowerOutput(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* 设定输出短路保护时间 */
|
/* 设定输出短路保护时间 */
|
||||||
if (num == g_cfgParameter.shortCircuitJudgmentDelay) {
|
if (num == g_cfgParameter.shortCircuitJudgmentDelay) {
|
||||||
num = 0;
|
num = 0;
|
||||||
|
|
|
@ -528,6 +528,8 @@ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hdma)
|
||||||
PV_VOLT_IN_capture.outData = (adcBuff[3] + adcBuff[7] + adcBuff[11] + adcBuff[15] + adcBuff[19]
|
PV_VOLT_IN_capture.outData = (adcBuff[3] + adcBuff[7] + adcBuff[11] + adcBuff[15] + adcBuff[19]
|
||||||
+ adcBuff[23] + adcBuff[27] + adcBuff[31] + adcBuff[35] + adcBuff[39]) / indata16_size;
|
+ adcBuff[23] + adcBuff[27] + adcBuff[31] + adcBuff[35] + adcBuff[39]) / indata16_size;
|
||||||
|
|
||||||
|
// WORK_VOLT_capture.outData = ;
|
||||||
|
|
||||||
setSoftShortCircuit(DSG_CURR_capture.outData);
|
setSoftShortCircuit(DSG_CURR_capture.outData);
|
||||||
|
|
||||||
chargControl();
|
chargControl();
|
||||||
|
|
|
@ -196,7 +196,7 @@ void Error_Handler(void)
|
||||||
/* User can add his own implementation to report the HAL error return state */
|
/* User can add his own implementation to report the HAL error return state */
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
/* USER CODE END Error_Handler_Debug */
|
/* USER CODE END Error_Handler_Debug */
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ void NMI_Handler(void)
|
||||||
void HardFault_Handler(void)
|
void HardFault_Handler(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN HardFault_IRQn 0 */
|
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||||
|
NVIC_SystemReset();
|
||||||
/* USER CODE END HardFault_IRQn 0 */
|
/* USER CODE END HardFault_IRQn 0 */
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,6 +67,7 @@ typedef enum {
|
||||||
hardwareShortCircuitProtection, //硬件短路保护
|
hardwareShortCircuitProtection, //硬件短路保护
|
||||||
hardwareInputProtection, //硬件防反输入保护
|
hardwareInputProtection, //硬件防反输入保护
|
||||||
InputProtection, //软件防反输入保护
|
InputProtection, //软件防反输入保护
|
||||||
|
startEvent, //启动
|
||||||
}eventsOrderRecordMode;
|
}eventsOrderRecordMode;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue