Update firmware version to 1.0.10, add hv_tick parameter to PSU control, enhance serial control with response handling, and improve stop button control logic.

This commit is contained in:
2026-04-13 20:01:44 +03:00
parent 14b4f0595f
commit c59d150b23
21 changed files with 25914 additions and 25379 deletions
+11 -1
View File
@@ -149,6 +149,7 @@ void PSU_Init(){
PSU0.power_limit = PSU_MAX_POWER; // kW
PSU0.hv_mode = 0;
PSU0.hv_tick = 0;
PSU_Enable(0, 0);
}
@@ -265,7 +266,15 @@ void PSU_ReadWrite(){
if(PSU0.ready){
PSU_SetVoltageCurrent(0, CONN.RequestedVoltage, CONN.RequestedCurrent); // Normal mode
ED_Delay(CAN_DELAY);
if(CONN.MeasuredVoltage>490) PSU0.hv_mode = 1;
if(CONN.MeasuredVoltage > 490){
if(PSU0.hv_tick == 0){
PSU0.hv_tick = HAL_GetTick();
}else if((HAL_GetTick() - PSU0.hv_tick) >= 10000){
PSU0.hv_mode = 1;
}
}else{
PSU0.hv_tick = 0;
}
}
// PSU_SetHVMode(0, PSU0.hv_mode); // auto set, no need
@@ -339,6 +348,7 @@ void PSU_Task(void){
case PSU_READY:
// модуль готов, но выключен
PSU0.hv_mode = 0;
PSU0.hv_tick = 0;
RELAY_Write(RELAY_DC, 0);
if(!PSU0.ready){