Implement Roland Brochards' new acceleration maths clock-based.

His implementation was done on every step and as it turns out,
the very same maths works just fine in the clock interrupt.
Reason for the clock interrupt is: it allows about 3 times
higher step rates.

This strategy is not only substantially faster, but also
a bit smaller.

One funny anecdote: the acceleration initialisation value, C0,
was taken from elsewhere in the code as-is. Still it had to be
adjusted by a factor of sqrt(2) to now(!) match the physics
formulas and to get ramps reasonably matching the prediction
(and my pocket calculator). Apparently the code before
accumulated enough rounding errors to compensate for the
wrong formula.
Fix endstop stop condition for clock-based acceleration.

This required a strategy change, since move_state.n is no longer
decreasing in steps of 1.
dda.c/.h: move n and c back into the dda structure.

This is a preparation for starting a move from non-zero speeds,
which is needed for look-ahead. Keeping both variables in
move_state and doing the calculations in dda_start() is possible
in principle, but might not fit the tight time budget we have when
going from one movement to the next at high step rates.

To deal with this, we have to pre-calculate n and c, so we have
to move it back into the DDA structure. It was there a year ago
already, but moved into move_state to save RAM (move_state exists
only once, dda as often as there are movement queue entries).
Add a testcase for look-ahead (smooth curves).
dda.c: re-gain look-ahead compatibility.

We're here! Incredible high step rates as well as smooth
movements due to look-ahead.
look-ahead: take F_start into account on acceleration calculations.
gcode-process.c: fix HEATER_EXTRUDER reference.

A rare combination of factors makes this code assume HEATER_EXTRUDER
always exists, when that is not necessarily so.  Add the normal
guard around it.
dda.c: simplify start conditions calculation.
Restore simulation build target.

This code was accidentally removed long ago in a botched merge. This
patch recovers it and makes it build again. I've done minimal testing
and some necessary cleanup. It compiles and runs, but it probably still
has a few dust bunnies here and there.

I added registers and pin definitions to simulator.h and
simulator/simulator.c which I needed to match my Gen7-based config.
Other configs or non-AVR ports will need to define more or different
registers. Some registers are 16-bits, some are 8-bit, and some are just
constant values (enums). A more clever solution would read in the
chip-specific header and produce saner definitions which covered all
GPIOs. But this commit just takes the quick and easy path to support my
own hardware.

Most of this code originated in these commits:

	commit cbf41dd4adbdac8bd1ce0288b94266342fb62609
	Author: Stephan Walter <stephan@walter.name>
	Date:   Mon Oct 18 20:28:08 2010 +0200

	    document simulation

	commit 3028b297f31fa805db4c6f5077e1c3edb0ca5099
	Author: Stephan Walter <stephan@walter.name>
	Date:   Mon Oct 18 20:15:59 2010 +0200

	    Add simulation code: use "make sim"

Additional tweaks:

Revert va_args processing for AVR, but keep 'int' generalization
for simulation. gcc wasn't lying. The sim really aborts without this.

Remove delay(us) from simulator (obsolete).

Improve the README.sim to demonstrate working pronterface connection
to sim. Also fix the build instructions.
arduino.h: be includable for simulation code.
Makefile-AVR: define a common ATmega type for the simulator.

This is not ideal, yet. While this helps to compile the code,
code still doesn't compile completely. Likely, simulator code
shouldn't redefine what's on the chip.
Makefile-AVR: auto-detect simulation code ...

... and auto-ignore the files they replace.

To replace another file, simply copy it into the simulator dir,
then rename it from xxx.c to xxx_sim.c and you're done.
Restore simulator more to original version

I realize now the simulator does not want to be an AVR so much
as it wants to be a generic device.  Some AVR has sneaked in, but
my port a while back added more.  It was the wrong direction to go.
Revert more of that.
More simulator work.

Generalize the simulator pin definitions to divorce us more from
the specific chip being used. The pins defined in config.h are
ignored and replaced with stand-in enums referencing control
arrays in the simulator. Heater pins are replaced with standins,
too, but they overlap the other pins. Need to check if that's ok.