kliment / Sprinter

Firmware for RepRap printers and similar devices
432 stars 329 forks source link

Refactor homing #190

Closed felipesanches closed 12 years ago

felipesanches commented 12 years ago

The homing routines for each axis are basically the same code copy&pasted 3 times. So I refactored it.

I also plan to work on a z axis calibration routine similar to the Makerbot ThingOMatic one that will need to use a Z homing routine. By encapsulating the homing routine, it can be used in other gcodes out of the G28 case context where it is currently used.

If you don't like macros, I can refactor it again to be implemented as an inline function.

kliment commented 12 years ago

I think inline function would be better because homing is not performance-sensitive but inlining it would help readability.