00
Dependencies: mcp2515 mbed-dev-f303
Diff: DATA_COMMAND/data_command.cpp
- Revision:
- 2:cd74a8cb03b0
- Parent:
- 0:d80c66cb1b3a
- Child:
- 7:d1b09098579b
--- a/DATA_COMMAND/data_command.cpp Tue Nov 17 11:32:58 2020 +0000 +++ b/DATA_COMMAND/data_command.cpp Thu Nov 19 07:59:28 2020 +0000 @@ -98,8 +98,7 @@ case('e'): command.printf("\n\rPF exiting motor mode\r"); // ExitMotorMode(&PF_can); - ExitMotorMode(&knee_txMsg); - ExitMotorMode(&ankle_txMsg); + return_zero = 0; // 停止回0 c_lock = 2; // 电机位置锁无效 // send_enable = 0; // main不发送CAN位置命令 @@ -107,8 +106,7 @@ case('m'): command.printf("\n\rPF entering PC motor mode\r"); // EnterMotorMode(&PF_can); - EnterMotorMode(&knee_txMsg); - EnterMotorMode(&ankle_txMsg); + return_zero = 0; c_lock = 1; // 电机位置锁定 @@ -117,8 +115,7 @@ case('M'): command.printf("\n\rPF entering BOARD motor mode\r"); // EnterMotorMode(&PF_can); - EnterMotorMode(&knee_txMsg); - EnterMotorMode(&ankle_txMsg); + return_zero = 0; c_lock = 0; // 电机位置解锁 // send_enable = 0; // M模式下,命令是否发送,命令是什么由calculate决定 @@ -126,8 +123,7 @@ case('z'): command.printf("\n\rPF zeroing\r"); // Zero(&PF_can); - Zero(&knee_txMsg); - Zero(&ankle_txMsg); + return_zero = 0; c_lock = 2; // send_enable = 0; @@ -135,8 +131,7 @@ case('r'): command.printf("\n\rPF return zero\r"); // EnterMotorMode(&PF_can); - EnterMotorMode(&knee_txMsg); - EnterMotorMode(&ankle_txMsg); + return_zero = 1; c_lock = 2; // send_enable = 1;