From 5cdc31396fd42f0b8bf74df41aa36f982de0f149 Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Thu, 21 Feb 2008 23:45:51 +0100 Subject: Remove some unused function. The functionalities concerning the flash are now in the flash module. --- digital/avr/modules/spi/spi.c | 43 ++++++--------------------------- digital/avr/modules/spi/spi.h | 19 ++------------- digital/avr/modules/spi/test/test_spi.c | 28 ++++++++++----------- 3 files changed, 23 insertions(+), 67 deletions(-) (limited to 'digital') diff --git a/digital/avr/modules/spi/spi.c b/digital/avr/modules/spi/spi.c index 8fb35bb9..ea8743a8 100644 --- a/digital/avr/modules/spi/spi.c +++ b/digital/avr/modules/spi/spi.c @@ -45,36 +45,27 @@ static spi_t spi_global; * \param user_data the user data to be provieded in the function call back. */ void -spi_init(uint8_t sprc, spi_recv_cb_t cb, void *user_data) +spi_init(uint8_t sprc) { SPCR = sprc; - spi_global.recv_cb = cb; - spi_global.recv_user_data = user_data; spi_global.interruption = sprc >> 7; } /** Send a data to the Slave. * \param data the data to send - * \param length the length of the data in bytes. */ void -spi_send(uint8_t *data, uint8_t length) +spi_send(uint8_t data) { - uint8_t i; // enables the SPI if not enabled. SPCR |= SPI_ENABLE; - for ( i = 0; i < length; i++) - { - // Insert the data in the data register, the SPI will begin to send it - // automatically. - SPDR = data[i]; + SPDR = data; - if (!spi_global.interruption) - { - // Wait the end of the transmission. - while(!(SPSR & (1<