Add simulation info for SimulAVR.

This shouldn't change the running binary at all, so it shouldn't
harm. However, it allows to run Teacup inside SimulAVR and accessing
Teacups' serial line through the console/terminal.

For detailed instructions, see http://reprap.org/wiki/SimulAVR .
This commit is contained in:
Markus Hitter 2013-11-11 11:37:31 +01:00
parent ab65ba6c95
commit 71ae941a09
2 changed files with 16 additions and 1 deletions

View File

@ -127,7 +127,14 @@ CFLAGS += -finline-functions-called-once
CFLAGS += -mcall-prologues CFLAGS += -mcall-prologues
LDFLAGS = -Wl,--as-needed LDFLAGS = -Wl,--as-needed
LDFLAGS += -Wl,--gc-sections # Doesn't work for simulavr, can't allow dead code removal.
#LDFLAGS += -Wl,--gc-sections
ifneq ($(realpath ../simulavr/src/simulavr_info.h),)
# Neccessary for simulavr support, doesn't hurt others.
CFLAGS += -DSIMINFO
LDFLAGS += -Wl,--section-start=.siminfo=0x900000
endif
LIBS = -lm LIBS = -lm

View File

@ -50,6 +50,14 @@
#include "intercom.h" #include "intercom.h"
#include "simulator.h" #include "simulator.h"
#ifdef SIMINFO
#include "../simulavr/src/simulavr_info.h"
SIMINFO_DEVICE("atmega644");
SIMINFO_CPUFREQUENCY(F_CPU);
SIMINFO_SERIAL_IN("D0", "-", BAUD);
SIMINFO_SERIAL_OUT("D1", "-", BAUD);
#endif
/// initialise all I/O - set pins as input or output, turn off unused subsystems, etc /// initialise all I/O - set pins as input or output, turn off unused subsystems, etc
void io_init(void) { void io_init(void) {
// disable modules we don't use // disable modules we don't use