summaryrefslogtreecommitdiffhomepage
path: root/digital
diff options
context:
space:
mode:
authorNicolas Schodet2013-03-18 20:07:09 +0100
committerNicolas Schodet2013-03-18 21:54:25 +0100
commit18d49b357a315d77e417d4a5c3942ec0d22997b8 (patch)
tree502be9acce31ea828ecb7adbf5b0e16bd94bd6c1 /digital
parentb39a44b59839b7636b603cf2bd9559a218923599 (diff)
digital/avr: small hacks to use AVR modules on ARM
Diffstat (limited to 'digital')
-rw-r--r--digital/avr/common/io.h4
-rw-r--r--digital/avr/make/Makefile.avr2
-rw-r--r--digital/avr/modules/math/fixed/fixed.h4
-rw-r--r--digital/avr/modules/utils/utils.h2
4 files changed, 6 insertions, 6 deletions
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 <avr/interrupt.h>
@@ -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"