summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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"