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

support read voltage

Signed-off-by: FuangCao <cavan.cao@foxmail.com>
FuangCao 5 лет назад
Родитель
Сommit
17e2230337
5 измененных файлов с 30 добавлено и 5 удалено
  1. 21 0
      Source/app_end_ctr.c
  2. 2 0
      Source/app_rs485_1.c
  3. 2 0
      Source/app_rs485_2.c
  4. 4 4
      Source/delay.c
  5. 1 1
      Source/sw_build_info.h

+ 21 - 0
Source/app_end_ctr.c

@@ -9,6 +9,7 @@
 #include "measure_temprature.h"
 #include "hardware_test.h"
 #include "drv_io.h"
+#include "measure_vol.h"
 
 END_CTR_SELF_SEND_STATUS end_ctr_self_ss;
 END_CTR_SELF_SEND_STATUS end_ctr_self_ss_new;
@@ -372,6 +373,8 @@ int8_t Handle_Can_Ctr_CMD(CAN_FRAME*can_ctr_frame)
 	
 }
 
+extern uint32_t acc12_overloader_times;
+
 int8_t Rsp_Can_Ctr_CMD(CAN_FRAME*can_ctr_frame)
 {
 	uint16_t key,len;
@@ -590,6 +593,20 @@ int8_t Rsp_Can_Ctr_CMD(CAN_FRAME*can_ctr_frame)
 					Ca_Chu_Test_Info();
 					buf[len++] = 0;
 					break;
+				case 3:
+					memcpy(buf + len, &acc12_overloader_times, sizeof(acc12_overloader_times));
+					len += sizeof(acc12_overloader_times);
+					break;
+				case 4:
+					acc12_overloader_times = 0;
+					buf[len++] = 0;
+					break;
+				case 5: {
+					uint32_t voltage = Measure_Vol();
+					memcpy(buf + len, &voltage, sizeof(voltage));
+					len += sizeof(voltage);
+					break;
+				}
 				default:
 					buf[len++] = 0;
 					break;
@@ -874,8 +891,12 @@ void ACC12_OVER_Loader_Timeout(void)
 	
 }
 
+uint32_t acc12_overloader_times;
+
 void ACC12_OVER_Loader_Interrupt(void)
 {
+	acc12_overloader_times++;
+
 #if ACC2_USE_PWM
 	/*if(acc12_delay.set)
 			return;

+ 2 - 0
Source/app_rs485_1.c

@@ -67,11 +67,13 @@ uint8_t SUB_BMS_1_DEC(void)
 
 void RS485_Communication_Time_Out_1(void)
 {
+#if 0
 	if (end_ctr_self_ss_new.xl_sta && BAT1_IS_OPEN()) {
 		sub_bms_info_1.sub_bms_cmd.operate = OP_READ_INFO;
 		sub_bms_info_1.rs485_time_out = 1;
 		return;
 	}
+#endif
 
 	if(sub_bms_info_1.rs485_connect)
 	{

+ 2 - 0
Source/app_rs485_2.c

@@ -63,11 +63,13 @@ uint8_t SUB_BMS_2_DEC(void)
 
 void RS485_Communication_Time_Out_2(void)
 {
+#if 0
 	if (end_ctr_self_ss_new.xl_sta && BAT2_IS_OPEN()) {
 		sub_bms_info_2.sub_bms_cmd.operate = OP_READ_INFO;
 		sub_bms_info_2.rs485_time_out = 1;
 		return;
 	}
+#endif
 
 	if(sub_bms_info_2.rs485_connect)
 	{

+ 4 - 4
Source/delay.c

@@ -130,12 +130,12 @@ void SysTick_Handler(void)
 					sub_rs485_time_out_1.com_err_count = 0;
 					g_event |= SUB_BMS_1_RS485_DISC_EVENT;
 
-					if(test_info.ti_set)
+					// if(test_info.ti_set)
 						test_info.ti_bms_1.bms_err_cnt++;
 				}
 			}
 			
-			if(test_info.ti_set)
+			// if(test_info.ti_set)
 				test_info.ti_bms_1.bms_err_timeout_cnt++;
 			
 		}
@@ -161,12 +161,12 @@ void SysTick_Handler(void)
 					sub_rs485_time_out_2.com_err_count = 0;
 					g_event |= SUB_BMS_2_RS485_DISC_EVENT;
 
-					if(test_info.ti_set)
+					// if(test_info.ti_set)
 						test_info.ti_bms_2.bms_err_cnt++;
 				}
 			}
 
-			if(test_info.ti_set)
+			// if(test_info.ti_set)
 				test_info.ti_bms_2.bms_err_timeout_cnt++;
 		}
 	}

+ 1 - 1
Source/sw_build_info.h

@@ -1,3 +1,3 @@
 #pragma once
 
-#define CONFIG_VERSION "PS100XX_V01_0C111358"
+#define CONFIG_VERSION "PS100XX_V01_0C211439"