summaryrefslogtreecommitdiff
path: root/analog/motor-power-avr/src
diff options
context:
space:
mode:
Diffstat (limited to 'analog/motor-power-avr/src')
-rw-r--r--analog/motor-power-avr/src/avrconfig.h6
-rw-r--r--analog/motor-power-avr/src/main.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/analog/motor-power-avr/src/avrconfig.h b/analog/motor-power-avr/src/avrconfig.h
index 5090b572..7568aa01 100644
--- a/analog/motor-power-avr/src/avrconfig.h
+++ b/analog/motor-power-avr/src/avrconfig.h
@@ -84,6 +84,12 @@
/** Support for quote parameter. */
#define AC_PROTO_QUOTE 1
+/* spi - SPI module. */
+/** Select driver: HARD, SOFT, or NONE. */
+#define AC_SPI0_DRIVER HARD
+/** Same thing for an optionnal second SPI driver. */
+#define AC_SPI1_DRIVER NONE
+
/* mp */
#endif /* avrconfig_h */
diff --git a/analog/motor-power-avr/src/main.c b/analog/motor-power-avr/src/main.c
index f5928e2c..b839a72c 100644
--- a/analog/motor-power-avr/src/main.c
+++ b/analog/motor-power-avr/src/main.c
@@ -99,8 +99,8 @@ main (int argc, char **argv)
//PORTA = 0xff;
uart0_init ();
- spi_init (SPI_IT_DISABLE | SPI_ENABLE | SPI_MSB_FIRST | SPI_SLAVE |
- SPI_CPOL_FALLING | SPI_CPHA_SETUP | SPI_FOSC_DIV16);
+ spi_init (SPI_SLAVE, SPI_CPOL_FALLING | SPI_CPHA_SETUP, SPI_MSB_FIRST,
+ SPI_FOSC_DIV16);
init_timer_LR_ ();
init_curLim ();
//postrack_init ();
@@ -179,7 +179,7 @@ main_loop (void)
spi_frame_size = 0;
}
}
- if (PINB & _BV (SPI_BIT_SS))
+ if (PINB & _BV (4))
{
spi_frame_size = 0;
}