Skip to content

Commit

Permalink
Axis reports CPR consistent with pos. Removed TMC special case
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultrawipf committed Mar 19, 2024
1 parent 0d46ae0 commit 1e89464
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Firmware/FFBoard/Src/Axis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,13 +901,13 @@ CommandStatus Axis::command(const ParsedCommand& cmd,std::vector<CommandReply>&
if (cmd.type == CMDtype::get && this->drv->getEncoder() != nullptr)
{
uint32_t cpr = this->drv->getEncoder()->getCpr();
#ifdef TMC4671DRIVER
TMC4671 *tmcdrv = dynamic_cast<TMC4671 *>(this->drv.get()); // Special case for TMC. Get the actual encoder resolution
if (tmcdrv && tmcdrv->hasIntegratedEncoder())
{
cpr = tmcdrv->getEncCpr();
}
#endif
//#ifdef TMC4671DRIVER // CPR should be consistent with position. Maybe change TMC to prescale to encoder count or correct readout in UI
// TMC4671 *tmcdrv = dynamic_cast<TMC4671 *>(this->drv.get()); // Special case for TMC. Get the actual encoder resolution
// if (tmcdrv && tmcdrv->hasIntegratedEncoder())
// {
// cpr = tmcdrv->getEncCpr();
// }
//#endif
replies.emplace_back(cpr);
}else{
return CommandStatus::ERR;
Expand Down

0 comments on commit 1e89464

Please sign in to comment.