From: zer0 Date: Sat, 9 Jan 2010 16:37:17 +0000 (+0100) Subject: better compilation on host X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3ec0dd7b5b128109dc84b60c8d1db47909f1f7d8;p=aversive.git better compilation on host --- diff --git a/modules/comm/spi/Makefile b/modules/comm/spi/Makefile index 8f06ed2..76162ee 100644 --- a/modules/comm/spi/Makefile +++ b/modules/comm/spi/Makefile @@ -2,7 +2,11 @@ TARGET = spi # List C source files here. (C dependencies are automatically generated.) +ifeq ($(HOST),avr) SRC = spi.c +else +SRC = spi_host.c +endif ########################################### diff --git a/modules/comm/spi/spi.h b/modules/comm/spi/spi.h index e370809..fe88108 100644 --- a/modules/comm/spi/spi.h +++ b/modules/comm/spi/spi.h @@ -74,10 +74,17 @@ typedef enum { * For more information on SPI formats, please see your CPU datasheet. */ typedef enum { +#ifdef HOST_VERSION + SPI_FORMAT_0, + SPI_FORMAT_1, + SPI_FORMAT_2, + SPI_FORMAT_3, +#else SPI_FORMAT_0 = 0x00, /* Sample rising Setup falling */ SPI_FORMAT_1 = _BV(CPHA), /* Setup rising Sample falling */ SPI_FORMAT_2 = _BV(CPOL), /* Sample falling Setup rising */ SPI_FORMAT_3 = _BV(CPHA) | _BV(CPOL), /* Setup falling Sample rising*/ +#endif } spi_format_t;