|
|
@@ -24,6 +24,12 @@ static void process_foc_command(foc_cmd_body_t *command);
|
|
|
|
|
|
static co_queue_t _cmd_queue;
|
|
|
|
|
|
+static bool _pc_connect = false;
|
|
|
+
|
|
|
+bool can_is_connect_pc(void) {
|
|
|
+ return _pc_connect;
|
|
|
+}
|
|
|
+
|
|
|
void foc_command_init(void) {
|
|
|
_cmd_queue = queue_create(16, sizeof(foc_cmd_body_t));
|
|
|
shark_task_create(foc_command_task, NULL);
|
|
|
@@ -615,7 +621,13 @@ static void process_foc_command(foc_cmd_body_t *command) {
|
|
|
len += mc_err_runtime_get(offset, response+3, sizeof(response) - 3);
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
+ case Foc_Set_LogLevel:
|
|
|
+ {
|
|
|
+ u8 level = decode_u8((u8 *)command->data);
|
|
|
+ _pc_connect = (level != 0)?true:false;
|
|
|
+ set_log_level(MOD_SYSTEM, (level != 0)?L_debug:L_disable);
|
|
|
+ break;
|
|
|
+ }
|
|
|
default:
|
|
|
{
|
|
|
erroCode = FOC_Unknow_Cmd;
|