From 560d6af97b1c6793ff8a9271372730df23ddb223 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Thu, 1 Oct 2015 11:36:05 +0200 Subject: [PATCH] msp430x: do not compile mtarch, which currently assumes 16-bit function pointers --- cpu/msp430/Makefile.msp430 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cpu/msp430/Makefile.msp430 b/cpu/msp430/Makefile.msp430 index 81c71f51a..6d5370575 100644 --- a/cpu/msp430/Makefile.msp430 +++ b/cpu/msp430/Makefile.msp430 @@ -35,10 +35,17 @@ endif CONTIKI_CPU_DIRS = $(CONTIKI_CPU_FAM_DIR) . dev MSP430 = msp430.c flash.c clock.c leds.c leds-arch.c \ - watchdog.c lpm.c mtarch.c rtimer-arch.c + watchdog.c lpm.c rtimer-arch.c UIPDRIVERS = me.c me_tabs.c slip.c crc16.c ELFLOADER = elfloader.c elfloader-msp430.c symtab.c +ifndef CPU_HAS_MSP430X +# include mtarch.c only in the non-large memory model case, because +# the current implementation assumes 16-bit addresses (function pointers +# stored as "unsigned short"). +MSP430 += mtarch.c +endif + ifeq ($(TARGET_MEMORY_MODEL),large) ELFLOADER = elfloader-msp430x.c symtab.c endif