Przeglądaj źródła

Revert "电流软保护这算到1s"

This reverts commit 0317ca6d13dbac75bd5e2c8016c997fac2026e53.
huhui 4 lat temu
rodzic
commit
50577b850e
1 zmienionych plików z 2 dodań i 4 usunięć
  1. 2 4
      Application/app/sox/soft_current_protect.c

+ 2 - 4
Application/app/sox/soft_current_protect.c

@@ -3,8 +3,7 @@
 #include "libs/shark_libs.h"
 #include "libs/circle_buffer.h"
 #include "libs/logger.h"
-
-#define MAX_SIZE 100
+#define MAX_SIZE 50
 typedef struct {
 	c_buffer_t   current;
 	c_buffer_t   delta_ts;
@@ -54,7 +53,6 @@ int soft_current_push(float current_ma){
 		circle_put_one_data(&_fifo_i2.delta_ts,delta_ts);
 	}
 	_fifo_i2.last_ts = shark_get_mseconds();
-	float f_sum = _fifo_i2.i2t_sum*(1.0f / ((float)_fifo_i2.ts_sum/1000.0f));
-	return (f_sum >= MAX_I2T); //ÕÛËãµ½1s
+	return (_fifo_i2.i2t_sum >= MAX_I2T); //ÕÛËãµ½1s
 }