From bdd377580a0374cc2893d386eb0f47b802232ac9 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 17 Apr 2009 00:25:16 +0200 Subject: * digital/avr/modules/spi: - fixed bad SPI2X mode. - prepare for software driver. --- analog/motor-power-avr/src/avrconfig.h | 6 ++++++ analog/motor-power-avr/src/main.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'analog') 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; } -- cgit v1.2.3