|
@@ -12,7 +12,6 @@
|
|
|
static soc_t _soc;
|
|
static soc_t _soc;
|
|
|
static uint8_t chargering = 0;
|
|
static uint8_t chargering = 0;
|
|
|
static u64 current_sample_ts = 0; //ms
|
|
static u64 current_sample_ts = 0; //ms
|
|
|
-static u64 charger_ts = 0; //ms
|
|
|
|
|
static u32 force_full_ts = 0xFFFFFFFF; //s
|
|
static u32 force_full_ts = 0xFFFFFFFF; //s
|
|
|
static float soc_delta_time = 0;
|
|
static float soc_delta_time = 0;
|
|
|
static float max_soc_delta_time = 0;
|
|
static float max_soc_delta_time = 0;
|
|
@@ -151,10 +150,6 @@ static __inline__ float _delta_time(void){
|
|
|
return soc_delta_time; //Ãë
|
|
return soc_delta_time; //Ãë
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static __inline__ u32 charger_time(void){
|
|
|
|
|
- return (shark_get_mseconds() - charger_ts);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
static __inline__ int can_modify_min_cap(void){
|
|
static __inline__ int can_modify_min_cap(void){
|
|
|
if (shark_get_seconds() > force_full_ts){
|
|
if (shark_get_seconds() > force_full_ts){
|
|
|
if ((shark_get_seconds() - force_full_ts) > MAX_TIME_FULL_TO_EMPTY) {
|
|
if ((shark_get_seconds() - force_full_ts) > MAX_TIME_FULL_TO_EMPTY) {
|
|
@@ -334,7 +329,6 @@ void soc_update(void){
|
|
|
if (_soc.capacity < 100) {
|
|
if (_soc.capacity < 100) {
|
|
|
is_force_full = 0;
|
|
is_force_full = 0;
|
|
|
}
|
|
}
|
|
|
- charger_ts = shark_get_mseconds();
|
|
|
|
|
#if LEAST_SQUARE==1
|
|
#if LEAST_SQUARE==1
|
|
|
start_least_square(0);
|
|
start_least_square(0);
|
|
|
#endif
|
|
#endif
|