|
@@ -50,7 +50,7 @@ static struct means_task _current_voltage_task;
|
|
|
static u32 current_voltage_task_handler(void);
|
|
static u32 current_voltage_task_handler(void);
|
|
|
static void init_current_voltage_task(void){
|
|
static void init_current_voltage_task(void){
|
|
|
_current_voltage_task._task.handler = current_voltage_task_handler;
|
|
_current_voltage_task._task.handler = current_voltage_task_handler;
|
|
|
- _current_voltage_task.delay = 15;
|
|
|
|
|
|
|
+ _current_voltage_task.delay = 25;
|
|
|
_current_voltage_task.index = CELLS_NUM;
|
|
_current_voltage_task.index = CELLS_NUM;
|
|
|
_measure_value.load_current = get_pack_current(&_measure_value.current_5238);
|
|
_measure_value.load_current = get_pack_current(&_measure_value.current_5238);
|
|
|
for (int i = 0; i < CELLS_NUM; i++){
|
|
for (int i = 0; i < CELLS_NUM; i++){
|
|
@@ -74,6 +74,9 @@ static u32 current_voltage_task_handler(void){
|
|
|
_current_voltage_task.index = (_current_voltage_task.index + 1) % CELLS_NUM;
|
|
_current_voltage_task.index = (_current_voltage_task.index + 1) % CELLS_NUM;
|
|
|
_measure_value.cell_vol[_current_voltage_task.index] = get_cell_voltage(_current_voltage_task.index) - bms_health()->internal_resistance[_current_voltage_task.index] * _measure_value.load_current/1000;
|
|
_measure_value.cell_vol[_current_voltage_task.index] = get_cell_voltage(_current_voltage_task.index) - bms_health()->internal_resistance[_current_voltage_task.index] * _measure_value.load_current/1000;
|
|
|
_voltage_notify();//֪ͨbms state ÓÐеĵçѹÊý¾Ý
|
|
_voltage_notify();//֪ͨbms state ÓÐеĵçѹÊý¾Ý
|
|
|
|
|
+ if (abs(_measure_value.load_current) >= MIN_CURRENT_FOR_CS1180) {
|
|
|
|
|
+ return 5;
|
|
|
|
|
+ }
|
|
|
return _current_voltage_task.delay;
|
|
return _current_voltage_task.delay;
|
|
|
}
|
|
}
|
|
|
|
|
|