修改驱动

This commit is contained in:
许晟昊 2025-01-14 13:58:35 +08:00
parent 002c586b14
commit 644c133326
2 changed files with 5 additions and 1 deletions

View File

@ -4,7 +4,7 @@
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",

View File

@ -299,6 +299,10 @@ void tmc2240_motor_set_angle(tmc2240_index_e index, int32_t angle)
return;
}
tmc->params.enable = FALSE;
_tmc2240_enable(index, tmc->params.enable);
tmc->motor.pulse_count = 0;
if (angle > 0)
{
tmc->params.direction = TMC2240_FORWARD;