forked from achamaikin/CCSModuleSW30Web
Log DC contactor open/close events for Everest diagnostics (v1.0.35).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ extern "C" {
|
||||
/* USER CODE BEGIN EC */
|
||||
#define FW_VERSION_MAJOR 1
|
||||
#define FW_VERSION_MINOR 0
|
||||
#define FW_VERSION_PATCH 34
|
||||
#define FW_VERSION_PATCH 35
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
+16
-1
@@ -758,6 +758,10 @@ void PSU_Task(void){
|
||||
// замыкаем DC-контактор и ждём подтверждение
|
||||
RELAY_Write(RELAY_DC, 1);
|
||||
if(PSU0.CONT_enabled){
|
||||
log_printf(LOG_INFO,
|
||||
"DC contactor closed (CONT_ON->CONNECTED, fb=%u, t=%lums)\n",
|
||||
(unsigned)PSU0.CONT_enabled,
|
||||
(unsigned long)PSU_StateTime());
|
||||
PSU_SwitchState(PSU_CONNECTED);
|
||||
}else if(PSU_StateTime() > 1000){
|
||||
PSU0.cont_fault = 1;
|
||||
@@ -885,6 +889,10 @@ void PSU_Task(void){
|
||||
|
||||
// если ток действительно упал или вышло время, отключаем DC
|
||||
if((CONN.MeasuredCurrent < 30) || (PSU_StateTime() > 5000)){
|
||||
log_printf(LOG_INFO,
|
||||
"DC contactor open cmd (CUR_DROP->CONT_OFF, I=%u, waited=%lums)\n",
|
||||
(unsigned)CONN.MeasuredCurrent,
|
||||
(unsigned long)PSU_StateTime());
|
||||
PSU_SwitchState(PSU_CONT_WAIT_ACK_OFF);
|
||||
}
|
||||
break;
|
||||
@@ -892,6 +900,9 @@ void PSU_Task(void){
|
||||
case PSU_CONT_WAIT_ACK_OFF:
|
||||
RELAY_Write(RELAY_DC, 0);
|
||||
if(!PSU0.CONT_enabled){
|
||||
log_printf(LOG_INFO,
|
||||
"DC contactor opened (fb=0, t=%lums)\n",
|
||||
(unsigned long)PSU_StateTime());
|
||||
PSU_Enable(0, 0);
|
||||
PSU_SwitchState(PSU_WAIT_ACK_OFF);
|
||||
}else if(PSU_StateTime() > 1000){
|
||||
@@ -899,7 +910,11 @@ void PSU_Task(void){
|
||||
CONN.chargingError = CONN_ERR_CONTACTOR;
|
||||
PSU_Enable(0, 0);
|
||||
PSU_SwitchState(PSU_WAIT_ACK_OFF);
|
||||
log_printf(LOG_ERR, "Contactor error, stopping...\n");
|
||||
log_printf(LOG_ERR,
|
||||
"DC contactor open timeout (relay=%u fb=%u, t=%lums)\n",
|
||||
(unsigned)RELAY_Read(RELAY_DC),
|
||||
(unsigned)PSU0.CONT_enabled,
|
||||
(unsigned long)PSU_StateTime());
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+3748
-3728
File diff suppressed because it is too large
Load Diff
+3748
-3727
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user