From 6e5e560e33fdcdbcccde95268edb8b170a923b0d Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Wed, 8 Sep 2010 22:50:56 +0000 Subject: [PATCH] Up to now *all* Contiki apps for the Apple2 were built for maximal RAM - which means that they can't return to OS level but must reboot on exit. However many apps can get along well with 1kB less memory - which allows them to exit to the OS. Therefore now the default is 1kB less memory - and apps actually needing maximal RAM can get it by adding WITH_REBOOT to their DEFINES. --- platform/apple2enh/Makefile.apple2enh | 13 +++++++++---- platform/apple2enh/contiki-main.c | 5 ++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/platform/apple2enh/Makefile.apple2enh b/platform/apple2enh/Makefile.apple2enh index 9ae6d8ede..4e16fa9f3 100644 --- a/platform/apple2enh/Makefile.apple2enh +++ b/platform/apple2enh/Makefile.apple2enh @@ -30,20 +30,25 @@ # # Author: Oliver Schmidt # -# $Id: Makefile.apple2enh,v 1.14 2010/05/08 07:26:20 oliverschmidt Exp $ +# $Id: Makefile.apple2enh,v 1.15 2010/09/08 22:50:57 oliverschmidt Exp $ # CONTIKI_SOURCEFILES += pfs.S -HIGHCODE_SOURCEFILES = process.c etimer.c uip_arp.c CONTIKI_CPU = $(CONTIKI)/cpu/6502 include $(CONTIKI_CPU)/Makefile.6502 +ifeq ($(findstring WITH_REBOOT,$(DEFINES)),WITH_REBOOT) + HIGHCODE_SOURCEFILES = process.c etimer.c uip_arp.c + LDFLAGS += -C apple2enh-reboot.cfg +else + HIGHCODE_SOURCEFILES = process.c etimer.c ethernet.c + LDFLAGS += -C apple2enh-loader.cfg +endif + # Set a target-specific variable value ${addprefix $(OBJECTDIR)/,${call oname, $(HIGHCODE_SOURCEFILES)}}: CFLAGS += --code-name HIGHCODE -LDFLAGS += -C apple2enh-reboot.cfg - ifeq ($(MAKECMDGOALS),disk) ifndef AC ${error AC not defined! You must specify where the AppleCommander jar resides} diff --git a/platform/apple2enh/contiki-main.c b/platform/apple2enh/contiki-main.c index c074ab4c8..e26ea4198 100644 --- a/platform/apple2enh/contiki-main.c +++ b/platform/apple2enh/contiki-main.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-main.c,v 1.20 2010/02/10 07:43:25 oliverschmidt Exp $ + * $Id: contiki-main.c,v 1.21 2010/09/08 22:50:56 oliverschmidt Exp $ */ #include "contiki-net.h" @@ -70,7 +70,10 @@ main(void) { struct ethernet_config *ethernet_config; +#if WITH_REBOOT rebootafterexit(); +#endif /* WITH_REBOOT */ + videomode(VIDEOMODE_80COL); process_init();