Commit Graph

16 Commits

Author SHA1 Message Date
Phil Hord 4b3c6fee7b Overload DEFINE_HEATER to take variable arguments
DEFINE_HEATER used to take 3 arguments.  Today it takes 4.  Soon it might
take 5.  The transition from 3 to 4 was painful while old config files
had not caught up to the new parameters.  Let's avoid the pain again in
the future by making this macro overloadable to accept any correct number
of arguments while doing the right thing.  Also let's accept 5 or 6
parameters so new configs will work with today's "older" code.
2017-03-21 14:50:28 +01:00
Phil Hord ab2c355821 Factor out some boilerplate code from configs
Configs are always included via a config_wrapper.h now, and configs always
must include this safety-definition for a missing DEFINE_HEATER.  Let's
simplify the configs by moving it to a common location.
2017-03-21 14:48:19 +01:00
Markus Hitter 801362d541 Lookahead: disable in config_wrapper.h, not in dda_lookahead.h.
Disable it only when appropriate, of course.

The move of this code makes Teacup compiling with both,
ACCELERATION_REPRAP and LOOKAHEAD enabled. Such a configuration
makes no sense, but can happen anyways.
2016-07-09 13:36:22 +02:00
Phil Hord 887a4eedd9 Simulator: fix pin numbering consistency
The simulator code is compiled with different definitions than the
rest of the code even when compiling the simulator.  This was done
originally to satisfy the compiler, but it was the wrong way to go.
The result is that the main Teacup code may decide to do things one
way (X_INVERT_DIR, for example) but the simulator code will do
things a different way (no X_INVERT_DIR).

Fix this by including the board and printer definitions also in the
simulator code, and use a simple enum trick to give consistent
definitions to the needed PIN definitions, safely ignoring the ones
the config does not use.

This requires that we include simulator.h after 'config.h' in all cases.
Manage that by moving simulator.h from its previous home in arduino.h
into config_wrapper.h.

After this change we will be able to reliably communicate the expected
state of the endstop pins from the simulator.
2016-05-26 11:04:30 +02:00
Markus Hitter 90969978df Configtool: replace DISPLAY_BUS parameter with a set of booleans.
Having a choice with a defined set of options is nice, but it
also requires these options to be #defined somewhere _before_
entering config.h. To keep class-like encapsulation, we'd need
two header files for each code unit, one for the options, another
one for the usual header.

That said, we use other examples of such options, e.g. CPU, F_CPU
or KINEMATICS. For CPU and F_CPU it works fine, because their
options are numbers or other values known by the compiler. For
KINEMATICS it kind of works, because this #define is used in only
one place ... and there it's suboptimal already, because no option-
set.

Anyways, I was unsure about this change and if it turns out to be
a poor decision later, it can be reverted.
2016-04-20 22:00:05 +02:00
Ruslan Popov 212eca7f8e Configtool: add display page implementation.
Most work by Ruslan Popov, collected from various commits and
made compatible with regression tests by Traumflug.

Display test code is now enabled by #defining DISPLAY_BUS to
i2c_twi.
2016-04-20 21:56:39 +02:00
Witold Sowa fdf6dbe849 Added support for MCP3008 and MCP3004 ADC for temperature read 2016-04-12 22:37:50 +02:00
Markus Hitter d2fcc57ed4 Introduce #ifdef SPI.
It's better to separate this by function than by usage.
2015-08-13 17:12:12 +02:00
Markus Hitter d7b59e2d33 ARM: implement heater-arm.c partially.
Currently at a fixed frequency of 1 kHz and with a fixed duty
cycle of 10%, but PWM does work.

As it turns out, PIO0_11 is not usable for PWM, because its timer
is already in use for the Step timer, and had to be disabled for
Gen7-ARM.

Test: define a heater in board.gen7-arm.h and a square signal
of 1 kHz with 10% duty cycle should appear on the heater pin.
2015-08-13 16:41:33 +02:00
Markus Hitter 05c7cf067f ARM: get dda_lookahead.c in.
Not much to say, simply works.
2015-08-12 14:26:37 +02:00
Markus Hitter 5a8d51cb19 ARM: get dda_maths.c, dda_kinematics.c and dda.c in.
All in one chunk, because it's all hardware-independent and doing
them one by one would end up on not more than some typing
exercises.

Compiles fine. For testing, remove if (DEBUG... for M114 in
gcode_process.c. Then one can see how the queue fills up when
sending movements and M114 repeatedly. This time with actual
coordinates.

No stepper movements, yet, because set_timer() is still empty.
2015-08-12 14:26:37 +02:00
Markus Hitter 104ed2f503 config_wrapper.h: move #include "arduino.h" here.
This #include "../arduino.h" was the only reason prohibiting
Configtool users from storing printer and board configuration
files wherever they wanted. Good reason to remove this restriciton.

This also solves a part of issue #152.
2015-05-30 18:40:05 +02:00
Markus Hitter 69e91b8acd ACCELERATION_TEMPORAL: always disable lookahead.
We simply don't support it, yet. And warn about it, so developers
get encouraged to add the few missing bits.
2015-04-21 02:51:31 +02:00
Markus Hitter 6da02f3112 config_wrapper.h: protect against USB/serial misconfiguration. 2014-10-18 21:00:16 +02:00
Markus Hitter 4ccca52367 Give users a hint in case they obviously forgot to read instructions. 2014-07-09 21:38:12 +02:00
Phil Hord 21e5343552 Add config.h wrapper to simplify test automation
Test code which wants to customize config.h can do so without
touching config.h itself by wrapping config.h in a macro variable
which is passed in to the compiler.  It defaults to "config.h" if
no override is provided.

This change would break makefile dependency checking since the selection
of a different header file on the command line is not noticed by make
as a build-trigger.  To solve this, we add a layer to the BUILDDIR path
so build products are now specific to the USER_CONFIG choice if it is
not "config.h".
2014-03-04 19:56:23 +01:00