tmc2130: Clear reset_flag by reading GSTAT on power-on

This is required as power-on reset will activate DIAG0, which is
used as a trigger for SG.
pull/170/head
Yuri D'Elia 2022-05-17 16:50:41 +02:00
parent f1d938b57f
commit 50a5f1db4d
1 changed files with 2 additions and 1 deletions

View File

@ -22,7 +22,8 @@ bool TMC2130::Init(const MotorParams &params, const MotorCurrents &currents, Mot
if (((IOIN >> 24U) != 0x11) | !(IOIN & (1U << 6U)))
return false; // @@TODO return some kind of failure
///clear reset_flag as we are (re)initializing
// read GSTAT to clear reset_flag as we are (re)initializing
CheckForErrors(params);
errorFlags.reset_flag = false;
///apply chopper parameters