From 22b640697ba446d7117c60657e7edda3c6db1880 Mon Sep 17 00:00:00 2001 From: Phil Hord Date: Mon, 27 Jul 2015 16:40:27 -0400 Subject: [PATCH] Replace SIMULATOR with __AVR__ in several places. Previously some features were excluded based on whether SIMULATOR was defined. But in fact these should have been included when __AVR__ was defined. These used to be the same thing, but now with ARM coming into the picture, they are not. Fix the situation so AVR includes are truly only used when __AVR__ is defined. The _crc16_update function appears to be specific to AVR; I've kept the alternate implementation limited to AVR in that case in crc.c. I think this is the right thing to do, but I am not sure. Maybe ARM has some equivalent function in their libraries. --- crc.c | 2 +- dda.c | 2 +- dda_lookahead.c | 2 +- dda_queue.c | 2 +- gcode_process.c | 2 +- intercom.c | 2 +- memory_barrier.h | 2 +- temp.c | 2 +- timer.c | 2 +- timer.h | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crc.c b/crc.c index b3ecf8f..9a52512 100644 --- a/crc.c +++ b/crc.c @@ -4,7 +4,7 @@ \brief crc16 routine */ -#ifndef SIMULATOR +#ifdef __AVR__ #include #else diff --git a/dda.c b/dda.c index d1128b8..e9b3912 100644 --- a/dda.c +++ b/dda.c @@ -7,7 +7,7 @@ #include #include #include -#ifndef SIMULATOR +#ifdef __AVR__ #include #endif diff --git a/dda_lookahead.c b/dda_lookahead.c index 60c856a..02f7597 100644 --- a/dda_lookahead.c +++ b/dda_lookahead.c @@ -11,7 +11,7 @@ #include #include #include -#ifndef SIMULATOR +#ifdef __AVR__ #include #endif diff --git a/dda_queue.c b/dda_queue.c index 9b2e26d..ae184f5 100644 --- a/dda_queue.c +++ b/dda_queue.c @@ -5,7 +5,7 @@ */ #include -#ifndef SIMULATOR +#ifdef __AVR__ #include #endif diff --git a/gcode_process.c b/gcode_process.c index 79c2435..cb9e23b 100644 --- a/gcode_process.c +++ b/gcode_process.c @@ -5,7 +5,7 @@ */ #include -#ifndef SIMULATOR +#ifdef __AVR__ #include #endif diff --git a/intercom.c b/intercom.c index 25b83ac..6cca1df 100644 --- a/intercom.c +++ b/intercom.c @@ -4,7 +4,7 @@ \brief motherboard <-> extruder board protocol */ -#ifndef SIMULATOR +#ifdef __AVR__ #include #include #endif diff --git a/memory_barrier.h b/memory_barrier.h index 2af71f7..6d3a3c7 100644 --- a/memory_barrier.h +++ b/memory_barrier.h @@ -13,7 +13,7 @@ if (save_reg) sei(); \ } -#else +#elif defined __AVR__ #include #include diff --git a/temp.c b/temp.c index 3cdcde7..fdeb32f 100644 --- a/temp.c +++ b/temp.c @@ -10,7 +10,7 @@ */ #include -#ifndef SIMULATOR +#ifdef __AVR__ #include #include #endif diff --git a/timer.c b/timer.c index 6ed99cb..ce77f6f 100644 --- a/timer.c +++ b/timer.c @@ -10,7 +10,7 @@ Teacup has tried numerous timer management methods, and this is the best so far. */ -#ifndef SIMULATOR +#ifdef __AVR__ #include #endif #include "memory_barrier.h" diff --git a/timer.h b/timer.h index a7118e1..1ba70ef 100644 --- a/timer.h +++ b/timer.h @@ -2,7 +2,7 @@ #define _TIMER_H #include -#ifndef SIMULATOR +#ifdef __AVR__ #include #endif #include "simulator.h"