Skip to content

Commit

Permalink
Fix for incorrect handling of transaction count on init (affects ESP3…
Browse files Browse the repository at this point in the history
…2 only?).
  • Loading branch information
terjeio committed Aug 30, 2022
1 parent 0ebb7c9 commit 9eae92b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tmc2209.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* tmc2209.c - interface for Trinamic TMC2209 stepper driver
*
* v0.0.4 / 2021-10-16 / (c) Io Engineering / Terje
* v0.0.5 / 2022-08-24 / (c) Io Engineering / Terje
*/

/*
Expand Down Expand Up @@ -162,7 +162,7 @@ bool TMC2209_Init (TMC2209_t *driver)

TMC2209_ReadRegister(driver, (TMC2209_datagram_t *)&driver->ifcnt);

return driver->ifcnt.reg.count - ifcnt == 7;
return (((uint8_t)driver->ifcnt.reg.count - ifcnt) & 0xFF) == 7;
}

uint16_t TMC2209_GetCurrent (TMC2209_t *driver)
Expand Down

0 comments on commit 9eae92b

Please sign in to comment.