Просмотр исходного кода

把充电器检测状态报给底座

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 5 лет назад
Родитель
Сommit
af5a0004c4
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      Application/app/protocol_old.c

+ 5 - 1
Application/app/protocol_old.c

@@ -69,7 +69,11 @@ static int get_response_data(uint8_t *data, uint8_t operate, uint8_t result){
 	
 	
 	response->health_state = *((uint16_t *)bms_health());
 	response->health_state = *((uint16_t *)bms_health());
 	response->balance_mask = 0x0;
 	response->balance_mask = 0x0;
-	response->misc_status = (ml5238_is_discharging() << 1) | (ml5238_is_charging() << 2) | (AUX_VOL_IS_OPEN() << 3) |(io_state()->aux_lock_detect << 5) | ((get_soc()->capacity==100) << 4) | (((get_soc()->flags & SOC_FLAG_CALIBRATED) == 0) << 6);
+	response->misc_status = (ml5238_is_discharging() << 1) | (ml5238_is_charging() << 2);
+	response->misc_status |= (AUX_VOL_IS_OPEN() << 3) |(io_state()->aux_lock_detect << 5);
+	response->misc_status |= ((get_soc()->capacity==100) << 4) | (((get_soc()->flags & SOC_FLAG_CALIBRATED) == 0) << 6);
+	response->misc_status |= io_state()->charger_detect_irq;
+	
 	response->result = (operate << 4) | result;
 	response->result = (operate << 4) | result;
 
 
 	head->size += sizeof(comm_response_t);
 	head->size += sizeof(comm_response_t);