reprappro/RepRapFirmware — pull request #40 by T3P3 (2014-04-14 20:48:28+00:00)
Title: Multi extruder support

Merge in the changes required for M160, multiple concurrent extruders, description:

Fixed to work with multiple concurrent extruder drives:
Default or M160 S1 (set use only one extruder drive)
"G1 En.n" adds the float n.n to the move buffer for the selected head
There is no change in behaviour for one extruder drive setups, or multiple extruder
setups where only one drive is used at any one time.

M160 Sn (set to use "n" extruder drives) eg
"M160 S3"
"G1 En.n:m.m:o.o" adds the floats to the move buffer in the following way:
moveBuffer[AXES+selectedHead) = n.n
moveBuffer[AXES+selectedHead+1) = m.m
moveBuffer[AXES+selectedHead+2) = o.o
so if selectedHead=0 move buffer ends up looking like this for a 5 extruder drive setup:
{x.x, y.y, z.z, n.n, m.m, o.o, 0.0,0.0, f.f}
where x,y,z are the axes and f is the feedrate.
If selected head > 0 then there is the possibility that more drives can be set than
exist, in that case the last values are discarded e.g:
"T3"
"M160 S3"
"G1 En.n:m.m:o.o"
would leave the move buffer on a 4 extruder drive setup looking like this:
{x.x, y.y, z.z, 0.0, 0.0, 0.0, n.n,m.m, f.f}