From 18d49b357a315d77e417d4a5c3942ec0d22997b8 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Mon, 18 Mar 2013 20:07:09 +0100 Subject: digital/avr: small hacks to use AVR modules on ARM --- digital/avr/common/io.h | 4 ++-- digital/avr/make/Makefile.avr | 2 +- digital/avr/modules/math/fixed/fixed.h | 4 ++-- digital/avr/modules/utils/utils.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'digital/avr') diff --git a/digital/avr/common/io.h b/digital/avr/common/io.h index 66a64e04..a1da8660 100644 --- a/digital/avr/common/io.h +++ b/digital/avr/common/io.h @@ -25,7 +25,7 @@ * * }}} */ -#ifndef HOST +#if defined (TARGET_avr) /* Avr part. */ #include @@ -63,7 +63,7 @@ intr_restore (intr_flags_t flags) SREG = flags; } -#else /* HOST */ +#elif defined (HOST) /* Same as on AVR. */ #define _BV(x) (1<<(x)) diff --git a/digital/avr/make/Makefile.avr b/digital/avr/make/Makefile.avr index 73ec6a2a..9547fd21 100644 --- a/digital/avr/make/Makefile.avr +++ b/digital/avr/make/Makefile.avr @@ -4,7 +4,7 @@ AVR_CFLAGS := $(CFLAGS) -mmcu=$(AVR_MCU) AVR_ASFLAGS := $(ASFLAGS) -mmcu=$(AVR_MCU) -AVR_CPPFLAGS := $(CPPFLAGS) $(AVR_DEFS) +AVR_CPPFLAGS := $(CPPFLAGS) $(AVR_DEFS) -DTARGET_avr=1 AVR_LDFLAGS := $(LDFLAGS) AVR_LDLIBS := $(LDLIBS) $(AVR_LIBS) diff --git a/digital/avr/modules/math/fixed/fixed.h b/digital/avr/modules/math/fixed/fixed.h index 89aa5ba4..4f909a61 100644 --- a/digital/avr/modules/math/fixed/fixed.h +++ b/digital/avr/modules/math/fixed/fixed.h @@ -37,7 +37,7 @@ * * Angles are mapped from [0, 2pi) to [0,1). */ -#ifndef HOST +#ifdef TARGET_avr /* Multiply f8.24 by f8.24, return f8.24. */ #define fixed_mul_f824(a, b) ({ \ @@ -51,7 +51,7 @@ fixed_mul_f824_asm (uint16_t dummy, int32_t a, int32_t b); int32_t fixed_div_f824 (int32_t a, int32_t b); -#else /* HOST */ +#else /* !TARGET_avr */ /** Multiply f8.24 by f8.24, return f8.24. */ extern inline diff --git a/digital/avr/modules/utils/utils.h b/digital/avr/modules/utils/utils.h index a54ee4ed..13dab3f4 100644 --- a/digital/avr/modules/utils/utils.h +++ b/digital/avr/modules/utils/utils.h @@ -25,7 +25,7 @@ * * }}} */ -#ifndef HOST +#if defined (TARGET_avr) # include "utils.avr.h" #else # include "utils.host.h" -- cgit v1.2.3