Skip to content

Commit

Permalink
Color-code stealth mode in the TMC2130 indicator (#306)
Browse files Browse the repository at this point in the history
Use a different color ("acid green") for stealth mode, so that we can
distinguish the driver state.

Co-authored-by: vintagepc <[email protected]>
  • Loading branch information
wavexx and vintagepc authored Apr 18, 2021
1 parent 07579a3 commit 616b76d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion parts/components/TMC2130.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ void TMC2130::_Draw(bool bIsSimple)
glVertex3f(350,0,0);
glVertex3f(350,10,0);
glVertex3f(0,10,0);
glColor3f(1,1,1);
if (m_bStealthMode)
glColor3f(0.9,1,0.4); // acid green is the new "stealth"
else
glColor3f(1,1,1);
if (m_bEnable)
{
glVertex3f(3,8,0);
Expand Down Expand Up @@ -155,6 +158,7 @@ void TMC2130::ProcessCommand()
{
case 0x00: // GCONF
RaiseDiag(m_regs.defs.DRV_STATUS.stallGuard); // Adjust DIAG out, it mayhave been reconfigured.
m_bStealthMode = m_regs.defs.GCONF.en_pwm_mode;
break;
case 0x6C: // Chopconf
m_uiStepIncrement = std::pow(2,m_regs.defs.CHOPCONF.mres);
Expand Down
2 changes: 1 addition & 1 deletion parts/components/TMC2130.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class TMC2130: public SPIPeripheral, public Scriptable
void ClearDiag();

bool m_bDir = false;
std::atomic_bool m_bEnable {true}, m_bConfigured {false};
std::atomic_bool m_bEnable {true}, m_bConfigured {false}, m_bStealthMode {false};

TMC2130_cfg_t cfg;
// Register definitions.
Expand Down
Binary file modified scripts/tests/snaps/ext1/MK3SMMU203.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scripts/tests/snaps/ext1/MK3SMMU204.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 616b76d

Please sign in to comment.