Kaynağa Gözat

support disable switch

Signed-off-by: FuangCao <cavan.cao@foxmail.com>
FuangCao 5 yıl önce
ebeveyn
işleme
e7591b4d18
5 değiştirilmiş dosya ile 9 ekleme ve 2 silme
  1. 6 0
      Source/app.c
  2. 1 0
      Source/app.h
  3. 0 1
      Source/app_end_ctr.c
  4. 1 0
      Source/drv_io.c
  5. 1 1
      Source/sw_build_info.h

+ 6 - 0
Source/app.c

@@ -148,11 +148,17 @@ uint8_t battery_wait_voltage_down(uint32_t voltage)
 	return 0;
 }
 
+uint8_t shark_switch_disabled;
+
 int8_t Battery_CB_Switch(uint8_t cb_operate)
 {
 	CB_VAL cb_val_temp;
 	uint16_t i = 0;
 
+	if (shark_switch_disabled && cb_operate != CB_BAT_NO && cb_operate_state != CB_BAT1_BAT2_SERIES) {
+		return cb_operate_state;
+	}
+
 	println("switch: %d", cb_operate);
 
 #define COM_TIMEOUT  (15)

+ 1 - 0
Source/app.h

@@ -84,6 +84,7 @@ extern uint8_t Check_CB_oper_sta_start;
 extern DELAY_COMMON Check_CB_oper_sta_delay;
 extern uint8_t is_intelligent;
 extern uint8_t CB_OPERATE_PRECEDENCE_Config;
+extern uint8_t shark_switch_disabled;
 
 __inline void Check_CB_Oper_Sta_Delay(void)
 {

+ 0 - 1
Source/app_end_ctr.c

@@ -140,7 +140,6 @@ uint8_t qws_iap_read_string(uint8_t *buff)
 }
 #endif
 
-
 int8_t Handle_Can_Ctr_CMD(CAN_FRAME*can_ctr_frame)
 {
 	uint16_t key;

+ 1 - 0
Source/drv_io.c

@@ -75,6 +75,7 @@ void QD_Enable_From(uint8_t on,uint8_t from)
 	Check_S11(on,FROM_QD);
 	QD_Enable(on);
 	QD_switch_from = from;
+	shark_switch_disabled = on;
 }
 
 uint8_t ACC2_Is_On(void)

+ 1 - 1
Source/sw_build_info.h

@@ -1,3 +1,3 @@
 #pragma once
 
-#define CONFIG_VERSION "PS100XX_V01_0C301712"
+#define CONFIG_VERSION "PS100XX_V01_0C311803"