Commit Graph

14 Commits

Author SHA1 Message Date
Markus Hitter 03ab34729e serial.h: remove an obsolete #include. 2015-07-31 02:01:36 +02:00
Markus Hitter 9a08675576 Rename all these new PROGMEM variables to end in _P.
Should be done for temptable in ThermistorTable.h, too, but this
would mess up an existing users' configuration.

This tries to put emphasis on the fact that you have to read
these values with pgm_read_*() instead of just using the variable.
Unfortunately, gcc compiler neither inserts PROGMEM reading
instructions automatically when reading data stored in flash,
nor does it complain or warn about the missing read instructions.

As such it's very easy to accidently handle data stored in flash
just like normal data. It'll compile and work ... you just read
arbitrary data (often, but not always zeros) instead of what you
intend.
2014-08-31 19:05:25 +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
Phil Hord 452e2e5cd9 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 cbf41dd4ad
	Author: Stephan Walter <stephan@walter.name>
	Date:   Mon Oct 18 20:28:08 2010 +0200

	    document simulation

	commit 3028b297f3
	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.

Appease all stock configs.

Stub out intercom and shush usb_serial when building simulator.

Pretend to be all chip-types for config appeasement.

Replace sim_timer with AVR-simulator timer:

The original sim_timer and sim_clock provided direct replacements
for timer/clock.c in the main code. But when the main code changed,
simcode did not. The main clock.c was dropped and merged into timer.c.
Also, the timer.c now has movement calculation code in it in some
cases (ACCELERATION_TEMPORAL) and it would be wrong to teach the
simulator to do the same thing. Instead, teach the simulator to
emulate the AVR Timer1 functionality, reacting to values written to
OCR1A and OCR1B timer comparison registers.

Whenever OCR1A/B are changed, the sim_setTimer function needs to be
called. It is called automatically after a timer event, so changes
within the timer ISRs do not need to bother with this.

A C++ class could make this requirement go away by noticing the
assignment. On the other hand, a chip-agnostic timer.c would help
make the main code more portable. The latter cleanup is probably
better for us in the long run.
2013-12-06 19:24:58 +01:00
Markus Hitter 9b018b7433 Make USB_SERIAL fit for the Arduino IDE.
This also includes renaming of USE_USB to USB_SERIAL for more
consistency.
2012-12-03 19:49:58 +01:00
Markus Hitter 481354a4a7 serial.h: get rid of compiler warnings recently introduced. 2012-11-08 16:37:52 +01:00
Markus Hitter 0b11812ce5 Make use of the new usb_serial (and drop usage of lufa_serial).
At this point in time not a single user of LUFA is known and
here is reported how usb_serial apparently works more reliable:

http://forums.reprap.org/read.php?147,33082,160724#msg-160724

So it's likely we can move from lufa_serial to usb_serial entirely.
2012-11-08 16:37:18 +01:00
Michael Moon 096d7dfdf3 Merge release-candidate-triffid branch 2011-01-07 23:09:13 +11:00
Stephan Walter 3028b297f3 Add simulation code: use "make sim" 2010-10-21 11:05:55 +11:00
Markus Hitter f799228a8e Remove old XON/XOFF implementation, as it's redundant now. 2010-10-05 21:04:06 +02:00
Michael Moon e78381c56d Move configuration to config.h.dist 2010-09-27 09:20:07 +10:00
Markus Hitter b2e1cfd8b5 Make XON/XOFF flow control compile. 2010-09-08 19:16:18 +02:00
Michael Moon 0b51c1d0ab Merge branch 'mendel-triffid'
Conflicts:
	dda.c
	gcode.c
	machine.h
	temp.c
2010-08-10 14:55:06 +10:00
Michael Moon 595b66a341 setting up new branch 2 2010-08-10 14:26:24 +10:00