Skip to content

Commit

Permalink
Revert "Reset SG when writing to GCONF or COOLCONF (vintagepc#300)"
Browse files Browse the repository at this point in the history
This reverts commit bc56fba.
  • Loading branch information
wavexx committed Mar 29, 2021
1 parent bc56fba commit a64f2ad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions parts/components/TMC2130.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ void TMC2130::ProcessCommand()
switch (m_cmdProc.bitsIn.address)
{
case 0x00: // GCONF
case 0x6D: // COOLCONF
// Reset and adjust DIAG out
m_regs.defs.DRV_STATUS.stallGuard = false;
RaiseDiag(m_regs.defs.DRV_STATUS.stallGuard);
RaiseDiag(m_regs.defs.DRV_STATUS.stallGuard); // Adjust DIAG out, it mayhave been reconfigured.
break;
case 0x6C: // Chopconf
m_uiStepIncrement = std::pow(2,m_regs.defs.CHOPCONF.mres);
Expand Down
6 changes: 2 additions & 4 deletions scripts/tests/test_TMC2130.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,8 @@ int main()
step();
printf("DIAGDISABLE %02x\n",PINA&0x02);

// Keep existing configuration (DIAG0_stall && pushpull),
// but ensure DIAG is cleared when GCONF is written to
printf("DIAG %02x\n",PINA&0x02);
TMCTX(0x80,1U<<7U | 1U << 12);
TMCTX(0x80,1U<<7U); // DIAG0_stall, Act low

printf("DIAG %02x\n",PINA&0x02);


Expand Down
1 change: 0 additions & 1 deletion scripts/tests/test_TMC2130.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ Board::Pause()
GLHelper::SnapRect(tests/snaps/TMC04,0,164,500,80)
Board::Resume()
Serial0::NextLineMustBe(DIAGDISABLE 02)
Serial0::NextLineMustBe(DIAG 02)
Serial0::NextLineMustBe(DIAG 00)
Board::Quit()

0 comments on commit a64f2ad

Please sign in to comment.