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