修改前端输入功率较低时的执行方式
This commit is contained in:
parent
a31b9af810
commit
25af1a47ff
|
@ -62,6 +62,9 @@ void start(void)
|
|||
|
||||
uartCommonInit();
|
||||
|
||||
|
||||
// setDutyRatio(0.15f);
|
||||
|
||||
task_Init();
|
||||
|
||||
startInfo();
|
||||
|
@ -72,7 +75,7 @@ void start(void)
|
|||
// HAL_Delay(1000);
|
||||
// }
|
||||
/* 启动事件 */
|
||||
insertEventsOrderRecord(startEvent);
|
||||
// insertEventsOrderRecord(startEvent);
|
||||
|
||||
TimeSliceOffset_Start();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ void Init(void)
|
|||
// HAL_Delay(10000);
|
||||
|
||||
config_info_start();
|
||||
|
||||
|
||||
Init_debug_uart();
|
||||
|
||||
ADC_Capture_Init();
|
||||
|
@ -49,8 +49,8 @@ void Init(void)
|
|||
// POW_OUT_PCON_Open();
|
||||
HAL_Delay(100);
|
||||
setPowerOutput(TRUE);
|
||||
resetCheckImpedanceState();
|
||||
|
||||
// EN_PWMOUT_Eable();
|
||||
// setDutyRatio(0.5);
|
||||
// while (1) {
|
||||
// log_info("Init_debug_uart \n");
|
||||
|
|
|
@ -299,12 +299,23 @@ void checkFFMOS_CON(void)
|
|||
// FFMOS_CON_Close();
|
||||
// }
|
||||
|
||||
if (getChargCurrent() > 5.0f && FALSE == FFMOS_CON_read()) {
|
||||
FFMOS_CON_Open();
|
||||
static uint8_t num = 100;
|
||||
if (getChargCurrent() > 8.0f && FALSE == FFMOS_CON_read()) {
|
||||
num--;
|
||||
if (!num) {
|
||||
FFMOS_CON_Open();
|
||||
}
|
||||
}
|
||||
else if (getChargCurrent() < 2.0f && TRUE == FFMOS_CON_read()) {
|
||||
// num--;
|
||||
// if (!num) {
|
||||
// FFMOS_CON_Close();
|
||||
// }
|
||||
FFMOS_CON_Close();
|
||||
}
|
||||
else {
|
||||
num = 100;
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
|
@ -360,16 +371,18 @@ void setOverLoad(void)
|
|||
*/
|
||||
void lowInputLoadDetection(void)
|
||||
{
|
||||
static int num = 0;
|
||||
static int num = 0;
|
||||
|
||||
if (excessiveLoadInterruptFlag == TRUE && getOutputVoltage() < g_cfgParameter.inputPowerLowDetectionVolt) {
|
||||
num++;
|
||||
// setOverLoad();
|
||||
} else {
|
||||
num = 0;
|
||||
excessiveLoadInterruptFlag = FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (excessiveLoadInterruptFlag == TRUE && num == g_cfgParameter.inputPowerLowDetectionDelay) {
|
||||
excessiveLoadInterruptFlag = FALSE;
|
||||
setOverLoad();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -334,20 +334,34 @@ void mppt_readJust(void)
|
|||
// return;
|
||||
|
||||
/* 调节电压,两个电压步调节 */
|
||||
static float stepV1 = 0.2;
|
||||
static float stepV2 = 0.05;
|
||||
static float Power = 0;
|
||||
static float totalPower = 0;
|
||||
static float powerData[50] = {0};
|
||||
static uint8_t powerIndex = 0;
|
||||
// static float totalPower = 0;
|
||||
// static float powerData[50] = {0};
|
||||
// static uint8_t powerIndex = 0;
|
||||
|
||||
/* 获取50次的平均值 */
|
||||
totalPower -= powerData[powerIndex];
|
||||
powerData[powerIndex] = getOutputVoltage() * getChargCurrent();
|
||||
totalPower += powerData[powerIndex];
|
||||
powerIndex++;
|
||||
if (powerIndex >= 50) {
|
||||
powerIndex = 0;
|
||||
static float totalChargeCurr = 0;
|
||||
static float chargeCurrData[50] = {0};
|
||||
static uint8_t chargeCurrIndex = 0;
|
||||
|
||||
/* 获取50次值的和 */
|
||||
totalChargeCurr -= chargeCurrData[chargeCurrIndex];
|
||||
chargeCurrData[chargeCurrIndex] = getChargCurrent();
|
||||
totalChargeCurr += chargeCurrData[chargeCurrIndex];
|
||||
chargeCurrIndex++;
|
||||
if (chargeCurrIndex >= 50) {
|
||||
chargeCurrIndex = 0;
|
||||
}
|
||||
|
||||
// totalPower -= powerData[powerIndex];
|
||||
// powerData[powerIndex] = getOutputVoltage() * getChargCurrent();
|
||||
// totalPower += powerData[powerIndex];
|
||||
// powerIndex++;
|
||||
// if (powerIndex >= 50) {
|
||||
// powerIndex = 0;
|
||||
// }
|
||||
|
||||
static float lPower = 0;
|
||||
static float lLPower = 0;
|
||||
// static float lLLPower = 0;
|
||||
|
@ -356,9 +370,6 @@ void mppt_readJust(void)
|
|||
// static float kp = 0.005;
|
||||
// static float ki = 0.00001;
|
||||
|
||||
static float stepV1 = 0.2;
|
||||
static float stepV2 = 0.08;
|
||||
|
||||
static uint8_t flag1 = 0; //表明上次运算是加还是减
|
||||
|
||||
/* 延时一段时间才判断 */
|
||||
|
@ -378,13 +389,14 @@ void mppt_readJust(void)
|
|||
}
|
||||
|
||||
if (getMosTemperState() == mosTemperReduce) {
|
||||
SolarInCircuitV = 16;
|
||||
SolarInCircuitV = 20;
|
||||
}
|
||||
|
||||
|
||||
flag = 0;
|
||||
// Power = totalPower / 30.0f;
|
||||
Power = totalPower;
|
||||
// Power = totalPower;
|
||||
Power = totalChargeCurr * getOutputVoltage();
|
||||
|
||||
static float powerT = 0;
|
||||
powerT = Power - lPower;
|
||||
|
@ -392,13 +404,88 @@ void mppt_readJust(void)
|
|||
powerT = -powerT;
|
||||
}
|
||||
|
||||
/* 滞环值 */
|
||||
float hysteresisValue1;
|
||||
float hysteresisValue2;
|
||||
/* 一段时间内电流都很小则固定电压输出 */
|
||||
static uint8_t currMinFlag = 0;
|
||||
static uint8_t currMinFlag1 = 0;
|
||||
// if (getChargCurrent() < 0.8f) {
|
||||
if (totalChargeCurr < 40) {
|
||||
// hysteresisValue1 = getChargCurrent() * 1.7f;
|
||||
// hysteresisValue2 = getChargCurrent() * 12;
|
||||
currMinFlag++;
|
||||
if (currMinFlag == 8) {
|
||||
currMinFlag = 0;
|
||||
SolarInCircuitV = 18.0f;
|
||||
currMinFlag1 = 1;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// else if (getChargCurrent() < 3 && currMinFlag1) {
|
||||
else if (totalChargeCurr < 150 && currMinFlag1) {
|
||||
currMinFlag1 = 0;
|
||||
currMinFlag = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// else if (getChargCurrent() < 7) {
|
||||
else if (totalChargeCurr < 350) {
|
||||
currMinFlag1 = 0;
|
||||
currMinFlag = 0;
|
||||
// hysteresisValue1 = getChargCurrent() * 1.1f;
|
||||
// hysteresisValue2 = getChargCurrent() * 10;
|
||||
hysteresisValue1 = totalChargeCurr / 45.0f;
|
||||
hysteresisValue2 = totalChargeCurr / 5.0f;
|
||||
}
|
||||
|
||||
// else if (getChargCurrent() < 20) {
|
||||
else if (totalChargeCurr < 1000) {
|
||||
currMinFlag1 = 0;
|
||||
currMinFlag = 0;
|
||||
// hysteresisValue1 = getChargCurrent() * 0.7f;
|
||||
// hysteresisValue2 = getChargCurrent() * 7;
|
||||
hysteresisValue1 = totalChargeCurr / 70.0f;
|
||||
hysteresisValue2 = totalChargeCurr / 7.0f;
|
||||
}
|
||||
|
||||
// else if (getChargCurrent() < 25) {
|
||||
else if (totalChargeCurr < 1250) {
|
||||
currMinFlag1 = 0;
|
||||
currMinFlag = 0;
|
||||
// hysteresisValue1 = getChargCurrent() * 0.5f;
|
||||
// hysteresisValue2 = getChargCurrent() * 5;
|
||||
hysteresisValue1 = totalChargeCurr / 100.0f;
|
||||
hysteresisValue2 = totalChargeCurr / 10.0f;
|
||||
}
|
||||
|
||||
else {
|
||||
currMinFlag1 = 0;
|
||||
currMinFlag = 0;
|
||||
// hysteresisValue1 = getChargCurrent() * 0.3f;
|
||||
// hysteresisValue2 = getChargCurrent() * 3;
|
||||
hysteresisValue1 = totalChargeCurr / 150.0f;
|
||||
hysteresisValue2 = totalChargeCurr / 16.0f;
|
||||
}
|
||||
|
||||
// else {
|
||||
// currMinFlag1 = 0;
|
||||
// currMinFlag = 0;
|
||||
// hysteresisValue1 = 120;
|
||||
// hysteresisValue2 = 100;
|
||||
// }
|
||||
|
||||
|
||||
static uint8_t numFlag = 0;
|
||||
// if ((lPower + 0.8f < Power) && (lLPower + 0.8f < Power) && (lLLPower + 0.8f < Power)) {
|
||||
// if ((lPower + 0.1f < Power) && (lLPower + 0.1f < Power)) {
|
||||
if ((lPower + 8.0f < Power) && (lLPower + 8.0f < Power)) {
|
||||
|
||||
if ((lPower + hysteresisValue1 < Power) && (lLPower + hysteresisValue1 < Power)) {
|
||||
numFlag = 0;
|
||||
// if ((lPower + 0.3f < Power)) {
|
||||
if (powerT > 250) {
|
||||
if (powerT > hysteresisValue2) {
|
||||
if (flag1) {
|
||||
SolarInCircuitV += stepV1;
|
||||
flag1 = 1;
|
||||
|
@ -416,9 +503,9 @@ void mppt_readJust(void)
|
|||
}
|
||||
}
|
||||
// } else if ((lPower - 0.8f > Power) && (lLPower - 0.8f > Power) && (lLLPower - 0.8f > Power)) {
|
||||
} else if ((lPower - 8.0f > Power) && (lLPower - 8.0f > Power)) {
|
||||
} else if ((lPower - hysteresisValue1 > Power) && (lLPower - hysteresisValue1 > Power)) {
|
||||
// } else if ((lPower - 0.3f > Power)) {
|
||||
if (powerT > 250) {
|
||||
if (powerT > hysteresisValue2) {
|
||||
numFlag = 0;
|
||||
if (flag1) {
|
||||
SolarInCircuitV -= stepV1;
|
||||
|
@ -441,7 +528,7 @@ void mppt_readJust(void)
|
|||
}
|
||||
|
||||
/* 一段时间内都未调节 */
|
||||
if (numFlag == 100) {
|
||||
if (numFlag == 10) {
|
||||
if (Power < 300) {
|
||||
SolarInCircuitV = 17.0f;
|
||||
}
|
||||
|
@ -456,9 +543,10 @@ void mppt_readJust(void)
|
|||
}
|
||||
|
||||
|
||||
if (SolarInCircuitV > 20.0f) {
|
||||
SolarInCircuitV = 20.0f;
|
||||
if (SolarInCircuitV > 19.0f) {
|
||||
SolarInCircuitV = 19.0f;
|
||||
}
|
||||
|
||||
else if (SolarInCircuitV < 16.0f) {
|
||||
SolarInCircuitV = 16.0f;
|
||||
}
|
||||
|
@ -479,7 +567,8 @@ void endChargWork(void)
|
|||
setChargControlFlag(FALSE);
|
||||
setDutyRatioToZero();
|
||||
setMPPT_Mode(noWork);
|
||||
beginStartControlTask();
|
||||
beginStartControlTask();
|
||||
EN_PWMOUT_Diseable();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -493,6 +582,7 @@ void stopChargWork(void)
|
|||
setChargControlFlag(FALSE);
|
||||
setDutyRatioToZero();
|
||||
setMPPT_Mode(noWork);
|
||||
EN_PWMOUT_Diseable();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -504,6 +594,7 @@ void stopChargWork(void)
|
|||
void beginChargWork(void)
|
||||
{
|
||||
beginStartControlTask();
|
||||
EN_PWMOUT_Eable();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -515,6 +606,7 @@ void beginChargWork(void)
|
|||
void startChargWork(void)
|
||||
{
|
||||
beginSoftStartTask();
|
||||
EN_PWMOUT_Eable();
|
||||
}
|
||||
|
||||
|
||||
|
@ -562,7 +654,7 @@ BOOL floatChargConditions(void)
|
|||
BOOL mpptChargConditions(void)
|
||||
{
|
||||
if (((g_cfgParameter.constantVoltageChargeV - 0.2f) > getBatteryVoltage())
|
||||
&& (getChargCurrent() > 0.1f)) {
|
||||
&& (getChargCurrent() > 0.05f)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -690,6 +782,7 @@ void BatteryChargControl(void)
|
|||
case MPPT:
|
||||
mpptCharge();
|
||||
// mppt_constantVoltage(17.5f);
|
||||
// setDutyRatio(0.1f);
|
||||
break;
|
||||
|
||||
case constantVoltage:
|
||||
|
|
|
@ -1447,6 +1447,9 @@ uint16_t SL_ReadRegisterYearMonth(void *pMsg)
|
|||
{
|
||||
timeInfo time;
|
||||
getRTC_Time(&time);
|
||||
|
||||
// debug_printf("%d-%d\n", time.year, time.month);
|
||||
|
||||
return (time.year << 8) | time.month;
|
||||
}
|
||||
|
||||
|
@ -1459,6 +1462,9 @@ uint16_t SL_ReadRegisterDayHour(void *pMsg)
|
|||
{
|
||||
timeInfo time;
|
||||
getRTC_Time(&time);
|
||||
|
||||
// debug_printf("%d-%d\n", time.day, time.hour);
|
||||
|
||||
return (time.day << 8) | time.hour;
|
||||
}
|
||||
|
||||
|
@ -1471,6 +1477,9 @@ uint16_t SL_ReadRegisterMinuteSecond(void *pMsg)
|
|||
{
|
||||
timeInfo time;
|
||||
getRTC_Time(&time);
|
||||
|
||||
// debug_printf("%d-%d\n", time.minute, time.second);
|
||||
|
||||
return (time.minute << 8) | time.second;
|
||||
}
|
||||
|
||||
|
@ -1612,6 +1621,10 @@ uint16_t SL_WriteRegisterMinuteSecond(void *pMsg)
|
|||
tempU8 = (uint8_t)(*(uint16_t*)pMsg);
|
||||
writeTime.second = tempU8;
|
||||
|
||||
// debug_printf("%d-%d\n", writeTime.year, writeTime.month);
|
||||
// debug_printf("%d-%d\n", writeTime.day, writeTime.hour);
|
||||
// debug_printf("%d-%d\n", writeTime.minute, writeTime.second);
|
||||
|
||||
setRTC_Time(&writeTime);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -59,8 +59,8 @@ float getDutyRatio(void)
|
|||
*/
|
||||
void setDutyRatio(float DutyRatio)
|
||||
{
|
||||
if (DutyRatio > 0.95f) {
|
||||
dutyRatio = 0.95f;
|
||||
if (DutyRatio > 0.9f) {
|
||||
dutyRatio = 0.9f;
|
||||
}
|
||||
else if (DutyRatio < 0.05f) {
|
||||
dutyRatio = 0.05f;
|
||||
|
|
|
@ -160,7 +160,7 @@ void task_Init(void)
|
|||
TimeSliceOffset_Register(&m_uart, Task_uart, uart_reloadVal, uart_offset);
|
||||
TimeSliceOffset_Register(&m_busFree, Task_busFree, busFree_reloadVal, busFree_offset);
|
||||
|
||||
TimeSliceOffset_Register(&m_SOE, Task_SOE, SOE_reloadVal, SOE_offset);
|
||||
TimeSliceOffset_Register(&m_SOE, Task_SOE, SOE_reloadVal, SOE_offset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -200,20 +200,20 @@ void Task_wdi(void)
|
|||
{
|
||||
feedDog();
|
||||
|
||||
debug_printf("chargCurrent:%f \n", getChargCurrent());
|
||||
debug_printf("outputVoltage:%f \n", getOutputVoltage());
|
||||
debug_printf("BatteryVoltage:%f \n", getBatteryVoltage());
|
||||
debug_printf("dischargCurrent:%f \n", getDischargCurrent());
|
||||
debug_printf("solarInCircuitVoltage:%f \n", getSolarInCircuitVoltage());
|
||||
debug_printf("HighSideMosTemperature:%f \n", getHighSideMosTemperature());
|
||||
debug_printf("InputVoltage:%f \n", getInputVoltage());
|
||||
debug_printf("DischargMosState:%d \n", getDischargMosState());
|
||||
debug_printf("MPPT_Mode:%d \n", getMPPT_Mode());
|
||||
debug_printf("loopImpedance:%f \n", getLoopImpedance());
|
||||
debug_printf("DutyRatio:%f \n", getDutyRatio());
|
||||
// debug_printf("OUT_VOLT_IN:%f \n", get_OUT_VOLT_IN());
|
||||
debug_printf("HAL_GetTick:%d \n", HAL_GetTick());
|
||||
debug_printf("getExChargeCurr:%f \n", getExChargeCurr());
|
||||
// debug_printf("chargCurrent:%f \n", getChargCurrent());
|
||||
// debug_printf("outputVoltage:%f \n", getOutputVoltage());
|
||||
// debug_printf("BatteryVoltage:%f \n", getBatteryVoltage());
|
||||
// debug_printf("dischargCurrent:%f \n", getDischargCurrent());
|
||||
// debug_printf("solarInCircuitVoltage:%f \n", getSolarInCircuitVoltage());
|
||||
// debug_printf("HighSideMosTemperature:%f \n", getHighSideMosTemperature());
|
||||
// debug_printf("InputVoltage:%f \n", getInputVoltage());
|
||||
// debug_printf("DischargMosState:%d \n", getDischargMosState());
|
||||
// debug_printf("MPPT_Mode:%d \n", getMPPT_Mode());
|
||||
// debug_printf("loopImpedance:%f \n", getLoopImpedance());
|
||||
// debug_printf("DutyRatio:%f \n", getDutyRatio());
|
||||
// // debug_printf("OUT_VOLT_IN:%f \n", get_OUT_VOLT_IN());
|
||||
// debug_printf("HAL_GetTick:%d \n", HAL_GetTick());
|
||||
// debug_printf("getExChargeCurr:%f \n", getExChargeCurr());
|
||||
|
||||
|
||||
// char buf[100];
|
||||
|
@ -307,7 +307,7 @@ void Task_refreshJudgeData(void)
|
|||
|
||||
/* 有电池,太阳能输出功率大,电池电压低于14V,同时回路阻抗未测试或需要重新测试 */
|
||||
if ((getCheckImpedanceState() == FALSE || getLoopImpedance() == 0.0f)
|
||||
&& (getBatteryState() == TRUE) && (getChargCurrent() > g_cfgParameter.maxChargCurr)
|
||||
&& (getBatteryState() == TRUE) && (getChargCurrent() > g_cfgParameter.minCheckLoopImpedanceChargCurr)
|
||||
&& (getOutputVoltage() > 9) && (getSolarInCircuitVoltage() > 14)
|
||||
&& (getBatteryVoltage() < 14)) {
|
||||
TimeSliceOffset_Register(&m_impedanceCalculation, Task_impedanceCalculation
|
||||
|
@ -378,7 +378,15 @@ void Task_startControl(void)
|
|||
}
|
||||
|
||||
/* 启动软起动任务 */
|
||||
TimeSliceOffset_Register(&m_softStart, Task_softStart, softStart_reloadVal, softStart_offset);
|
||||
// TimeSliceOffset_Register(&m_softStart, Task_softStart, softStart_reloadVal, softStart_offset);
|
||||
if (getBatteryState() == TRUE) {
|
||||
setMPPT_Mode(MPPT);
|
||||
} else {
|
||||
setMPPT_Mode(floatCharg);
|
||||
}
|
||||
|
||||
setChargControlFlag(TRUE);
|
||||
EN_PWMOUT_Eable();
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -387,7 +395,7 @@ void Task_startControl(void)
|
|||
* @retval
|
||||
*/
|
||||
void beginStartControlTask(void)
|
||||
{
|
||||
{
|
||||
TimeSliceOffset_Register(&m_startControl, Task_startControl, startControl_reloadVal, startControl_offset);
|
||||
m_startControl.runFlag = 1;
|
||||
}
|
||||
|
@ -409,7 +417,7 @@ void Task_softStart(void)
|
|||
EN_PWMOUT_Eable();
|
||||
}
|
||||
|
||||
else if (num > 70 || dutyRatio > 0.75f) {
|
||||
else if (num > 70 || dutyRatio > 0.6f) {
|
||||
TimeSliceOffset_Unregister(&m_softStart);
|
||||
m_softStart.runFlag = 0;
|
||||
|
||||
|
@ -423,7 +431,7 @@ void Task_softStart(void)
|
|||
setMPPT_Mode(floatCharg);
|
||||
}
|
||||
setChargControlFlag(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
setDutyRatio(getDutyRatio() + 0.01f);
|
||||
|
|
|
@ -182,24 +182,25 @@ BOOL readOnlyPowerOutputState(void)
|
|||
{
|
||||
// static volatile GPIO_PinState gpioTemp1, gpioTemp2, gpioTemp3;
|
||||
// GPIO_PinState gpioTemp1, gpioTemp2, gpioTemp3;
|
||||
GPIO_PinState gpioTemp1, gpioTemp2;
|
||||
// GPIO_PinState gpioTemp1, gpioTemp2;
|
||||
|
||||
gpioTemp1 = HAL_GPIO_ReadPin(POW_FF_CON_GPIO_Port, POW_FF_CON_Pin);
|
||||
gpioTemp2 = HAL_GPIO_ReadPin(POW_OUT_CON_GPIO_Port, POW_OUT_CON_Pin);
|
||||
// gpioTemp1 = HAL_GPIO_ReadPin(POW_FF_CON_GPIO_Port, POW_FF_CON_Pin);
|
||||
// gpioTemp2 = HAL_GPIO_ReadPin(POW_OUT_CON_GPIO_Port, POW_OUT_CON_Pin);
|
||||
// gpioTemp3 = HAL_GPIO_ReadPin(DSG_PROT_GPIO_Port, DSG_PROT_Pin);
|
||||
|
||||
if (gpioTemp1 == GPIO_PIN_SET
|
||||
&& gpioTemp2 == GPIO_PIN_SET
|
||||
// && gpioTemp3 == GPIO_PIN_SET) {
|
||||
) {
|
||||
return TRUE;
|
||||
}
|
||||
// if (gpioTemp1 == GPIO_PIN_SET
|
||||
// && gpioTemp2 == GPIO_PIN_SET
|
||||
// // && gpioTemp3 == GPIO_PIN_SET) {
|
||||
// ) {
|
||||
// return TRUE;
|
||||
// }
|
||||
|
||||
// if (HAL_GPIO_ReadPin(POW_FF_CON_GPIO_Port, POW_FF_CON_Pin)
|
||||
// && HAL_GPIO_ReadPin(POW_OUT_CON_GPIO_Port, POW_OUT_CON_Pin)
|
||||
// && HAL_GPIO_ReadPin(DSG_PROT_GPIO_Port, DSG_PROT_Pin)) {
|
||||
// return TRUE;
|
||||
// }
|
||||
if (!HAL_GPIO_ReadPin(POW_FF_CON_GPIO_Port, POW_FF_CON_Pin)
|
||||
&& HAL_GPIO_ReadPin(POW_OUT_CON_GPIO_Port, POW_OUT_CON_Pin)
|
||||
&& !HAL_GPIO_ReadPin(DSG_PROT_GPIO_Port, DSG_PROT_Pin)
|
||||
&& !HAL_GPIO_ReadPin(EXCHG_CURR_GPIO_Port, EXCHG_CURR_Pin)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -104,6 +104,7 @@ void MX_GPIO_Init(void)
|
|||
|
||||
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
|
||||
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
|
|
@ -47,7 +47,7 @@ void MX_TIM3_Init(void)
|
|||
htim3.Instance = TIM3;
|
||||
htim3.Init.Prescaler = 0;
|
||||
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim3.Init.Period = 720;
|
||||
htim3.Init.Period = 719;
|
||||
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_PWM_Init(&htim3) != HAL_OK)
|
||||
|
|
|
@ -413,7 +413,7 @@ TIM16.PeriodNoDither=999
|
|||
TIM16.Prescaler=71
|
||||
TIM3.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
|
||||
TIM3.IPParameters=PeriodNoDither,Channel-PWM Generation4 CH4
|
||||
TIM3.PeriodNoDither=720
|
||||
TIM3.PeriodNoDither=719
|
||||
TIM6.IPParameters=Prescaler,PeriodNoDither,TIM_MasterOutputTrigger
|
||||
TIM6.PeriodNoDither=9
|
||||
TIM6.Prescaler=71
|
||||
|
|
Loading…
Reference in New Issue