Go to file
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
attic Move the branch accel_clock into the attic. 2013-10-27 20:31:36 +01:00
extruder Temperature tables: add missing const qualifiers. 2013-11-16 17:31:28 +01:00
research Add research for dda-split. 2012-11-08 16:39:45 +01:00
simulator Restore simulation build target. 2013-12-06 19:24:58 +01:00
testcases Add another testcase, triangle-odd.gcode. 2013-11-28 23:43:10 +01:00
.gitignore Makefiles: build into a dedicated directory. 2013-02-05 14:11:03 +01:00
Doxyfile Remove LUFA. 2012-12-03 19:48:54 +01:00
LICENSE licensing- GPL-2 at the moment 2010-10-20 18:15:09 +11:00
Makefile-AVR Restore simulation build target. 2013-12-06 19:24:58 +01:00
Makefile-common Makefiles can have various names now. 2013-02-05 14:11:17 +01:00
README README: shorten drastically to avoid documentation duplication. 2013-02-05 14:10:55 +01:00
README.sim Restore simulation build target. 2013-12-06 19:24:58 +01:00
Teacup_Firmware.pde arduino ide: .pde must have the same name as the folder. 2011-02-27 22:08:41 +01:00
ThermistorTable.double.h Temperature tables: add missing const qualifiers. 2013-11-16 17:31:28 +01:00
ThermistorTable.single.h Temperature tables: add missing const qualifiers. 2013-11-16 17:31:28 +01:00
analog.c According to avr-libc documentation, ISR() handles SREG its self. 2013-10-27 20:01:51 +01:00
analog.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
arduino.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
arduino_32U4.h A number of teensy-related fine-adjustments. Mostly comments. 2012-11-08 16:36:22 +01:00
arduino_168_328p.h Fixed ADC channel handling. 2012-09-29 22:57:55 +02:00
arduino_644.h Fixed ADC channel handling. 2012-09-29 22:57:55 +02:00
arduino_1280.h Fixed ADC channel handling. 2012-09-29 22:57:55 +02:00
arduino_usb1286.h Add support for the AT90USB1286. 2013-03-24 16:17:54 +01:00
arduino_usb1287.h Fixed ADC channel handling. 2012-09-29 22:57:55 +02:00
calc.pl setting up new branch 2 2010-08-10 14:26:24 +10:00
clock.c Apply ATOMIC macros in a number of other obvious places. 2013-07-21 23:27:33 +02:00
clock.h clock.c: make clock_10ms() and clock_250ms() static. 2012-09-29 23:00:39 +02:00
config.default.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.gen3.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.gen6.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.gen7-v1.1-v1.3.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.gen7-v1.4.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.ramps-v1.2.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.ramps-v1.3.h config.ramps-v1.3.h: enable extruder axis. 2013-11-29 11:14:24 +01:00
config.sanguinololu-v1.1.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.sanguinololu-v1.2.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.sanguish.h Add config.sanguish.h. 2013-10-27 20:01:51 +01:00
config.teensy.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
config.teensypp.h config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
copier.c Merge release-candidate-triffid branch 2011-01-07 23:09:13 +11:00
copier.h setting up new branch 2 2010-08-10 14:26:24 +10:00
crc.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
crc.h use CRC16 to verify heater PID settings in eeprom 2011-02-20 17:13:09 +11:00
createTemperatureLookup.py Temperature tables: add missing const qualifiers. 2013-11-16 17:31:28 +01:00
dda.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
dda.h look-ahead: take F_end into account on acceleration calculations. 2013-12-06 19:24:58 +01:00
dda_lookahead.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
dda_lookahead.h Make lookahead basically working. 2013-07-11 22:02:13 +02:00
dda_maths.c dda_maths.c/.h: implement an integer inverse square root algorithm. 2013-10-27 20:01:51 +01:00
dda_maths.h Implement Roland Brochards' new acceleration maths clock-based. 2013-12-06 19:24:58 +01:00
dda_queue.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
dda_queue.h Move endstop handling into a time-based procedure. 2013-10-27 20:01:10 +01:00
debug.c setting up new branch 2 2010-08-10 14:26:24 +10:00
debug.h Sort DEBUG_ECHO properly. 2012-05-11 13:51:03 +02:00
delay.c Eliminate _delay(), delay() and _delay_us(). 2013-03-24 16:19:24 +01:00
delay.h delay.h: re-add falsely removed #include. 2013-03-24 16:19:25 +01:00
extract.py Added gcode documentation and extraction tool 2011-06-03 02:02:46 +10:00
func.sh func.sh: Fix a potential infinite loop in mendel_readsym_target 2011-05-08 00:36:55 +10:00
fuses.h make it even harder to unintentionally include fuse definitions 2011-02-04 11:04:15 +11:00
gcode_parse.c gcode_parse.c: process incoming digits earlier. 2013-03-24 16:17:02 +01:00
gcode_parse.h gcode_parse.h: remove unused union. 2012-08-16 23:43:07 +02:00
gcode_process.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
gcode_process.h gcode_process.c: make special moves non-public. 2011-02-27 11:55:01 +01:00
graycode.c disable greycode by default in arduino IDE 2011-02-17 21:52:15 +11:00
heater.c Wrap EEPROM storage related stuff in #ifdef EECONFIG. 2013-02-05 14:10:31 +01:00
heater.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
home.c Clean up some unused delay related stuff. 2013-03-24 16:19:21 +01:00
home.h Fixed single inclusion of file. Added missing define. 2011-08-16 14:09:49 +02:00
intercom.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
intercom.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
memory_barrier.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
mendel.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
mendel_cmd Merge release-candidate-triffid branch 2011-01-07 23:09:13 +11:00
pinio.c config.h: introduce PS_MOSFET_PIN for Sanguish support. 2013-10-27 20:01:51 +01:00
pinio.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
sd.c Eliminate _delay(), delay() and _delay_us(). 2013-03-24 16:19:24 +01:00
sender-mac.sh sender-mac.sh: another minor fix. 2011-09-30 21:02:25 +02:00
sender.sh sender.sh: Allow for "ok" to be surrounded by DEBUG output. 2011-03-04 19:42:00 +11:00
serial.c According to avr-libc documentation, ISR() handles SREG its self. 2013-10-27 20:01:51 +01:00
serial.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
sermsg.c M114 returns millimeters instead of steps 2011-04-26 14:44:17 +10:00
sermsg.h M114 returns millimeters instead of steps 2011-04-26 14:44:17 +10:00
sersendf.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
sersendf.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
simulator.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
temp.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
temp.h Move temp_all_zero() to heaters_all_zero(). 2013-01-03 15:34:47 +01:00
timer.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
timer.h Restore simulation build target. 2013-12-06 19:24:58 +01:00
usb_serial.c Restore simulation build target. 2013-12-06 19:24:58 +01:00
usb_serial.h Import USB Serial from http://www.pjrc.com/teensy/usb_serial.html 2012-11-08 16:36:48 +01:00
watchdog.c According to avr-libc documentation, ISR() handles SREG its self. 2013-10-27 20:01:51 +01:00
watchdog.h Wrap the watchdog in #ifdefs and disable it for now. My poor imagination 2010-10-02 16:15:29 +02:00

README

##############################################################################
#                                                                            #
# Teacup - lean and efficient firmware for RepRap printers                   #
#                                                                            #
# by Triffid Hunter, Traumflug, jakepoz, Markus Hitter, many others          #
#                                                                            #
##############################################################################

For installation instructions, see
http://reprap.org/wiki/Teacup_Firmware#Simple_Installation and/or
http://reprap.org/wiki/Teacup_Firmware#Developer_Installation

For documentation, see
http://reprap.org/wiki/Teacup_Firmware


##############################################################################
#                                                                            #
# This firmware is Copyright (c) ...                                         #
#   2009 - 2010 Michael Moon aka Triffid_Hunter                              #
#   2010 - 2013 Markus "Traumflug" Hitter <mah@jump-ing.de>                  #
#                                                                            #
# This program is free software; you can redistribute it and/or modify       #
# it under the terms of the GNU General Public License as published by       #
# the Free Software Foundation; either version 2 of the License, or          #
# (at your option) any later version.                                        #
#                                                                            #
# This program is distributed in the hope that it will be useful,            #
# but WITHOUT ANY WARRANTY; without even the implied warranty of             #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
# GNU General Public License for more details.                               #
#                                                                            #
# You should have received a copy of the GNU General Public License          #
# along with this program; if not, write to the Free Software                #
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA #
#                                                                            #
##############################################################################