diff --git a/Makefile-AVR b/Makefile-AVR index f021010..8be4173 100644 --- a/Makefile-AVR +++ b/Makefile-AVR @@ -127,7 +127,14 @@ CFLAGS += -finline-functions-called-once CFLAGS += -mcall-prologues 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 diff --git a/mendel.c b/mendel.c index 019a38e..0cca0a0 100644 --- a/mendel.c +++ b/mendel.c @@ -50,6 +50,14 @@ #include "intercom.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 void io_init(void) { // disable modules we don't use