better compilation on host
authorzer0 <zer0@carbon.local>
Sat, 9 Jan 2010 16:37:17 +0000 (17:37 +0100)
committerzer0 <zer0@carbon.local>
Sat, 9 Jan 2010 16:37:17 +0000 (17:37 +0100)
modules/comm/spi/Makefile
modules/comm/spi/spi.h

index 8f06ed2..76162ee 100644 (file)
@@ -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
 
 ###########################################
 
index e370809..fe88108 100644 (file)
@@ -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;