summaryrefslogtreecommitdiff
path: root/analog
diff options
context:
space:
mode:
authorNicolas Schodet2009-04-17 00:25:16 +0200
committerNicolas Schodet2009-04-17 00:25:16 +0200
commitbdd377580a0374cc2893d386eb0f47b802232ac9 (patch)
treeab540b91e372449e419f5b658f6be32d5e95af8e /analog
parente028b462ae78a400a3df396077d0abc16fb429a2 (diff)
* digital/avr/modules/spi:
- fixed bad SPI2X mode. - prepare for software driver.
Diffstat (limited to 'analog')
-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;
}