Browse Source

解决转把电压学习问题

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 2 years ago
parent
commit
c71c4ddfc6

+ 1 - 1
Applications/app/app.c

@@ -103,7 +103,7 @@ static u32 _app_trq_test_task(void *args) {
 }
 #endif
 void app_start(void){
-	set_log_level(MOD_SYSTEM, L_disable);
+	can_debug(false);
 	can_message_init();
 	nv_storage_init();
 	mc_err_block_init();

+ 5 - 0
Applications/foc/commands.c

@@ -31,6 +31,11 @@ bool can_is_connect_pc(void) {
 	return _pc_connect;
 }
 
+void can_debug(bool enable) {
+	_pc_connect = enable;
+	set_log_level(MOD_SYSTEM, enable?L_debug:L_disable);
+}
+
 void foc_command_init(void) {
 	_cmd_queue = queue_create(16, sizeof(foc_cmd_body_t));
 	shark_task_create(foc_command_task, NULL);

+ 1 - 0
Applications/foc/commands.h

@@ -140,6 +140,7 @@ typedef struct {
 
 void foc_command_init(void);
 bool foc_send_command(foc_cmd_body_t *command);
+void can_debug(bool enable);
 
 #endif /*_FOC_CMD_H__ */
 

+ 1 - 1
Applications/foc/motor/throttle.c

@@ -10,7 +10,7 @@
 static u8 err_mask;
 static float _start_v, _end_v;
 static bool _auto_detect_sv = true;
-static bool _auto_detect_sv_cnt = 0;
+static int  _auto_detect_sv_cnt = 0;
 static float _auto_detect_sv_totle = 0;
 #define CONFIG_SAFE_INV_V   0.06f