intelligent-agent / redeem

Firmware for Replicape
http://wiki.thing-printer.com/index.php?title=Redeem
GNU General Public License v3.0
36 stars 44 forks source link

Improve firmware_runtime.c significantly #211

Closed nick-parker closed 5 years ago

nick-parker commented 5 years ago

I wrote about this in #development a couple months ago but just now remembered to make the PR.

The current direction pin behavior is to set every pin either high or low every loop of the firmware, even if no pins have actually changed. Also, the higher level firmware doesn't remember direction pin status, and so it only ever sends high direction bits for the axes which are actively being stepped in a given loop iteration. This has two major downsides:

This PR adds a uint8 which remembers the current direction pin values, and diffs that against the commanded values for the set of axes being stepped each loop. If the diff is empty the direction register updates and the direction setup delay are both skipped.

ThatWileyGuy commented 5 years ago

I'm printing with this today.