diff --git a/cpu/avr/radio/rf230bb/halbb.c b/cpu/avr/radio/rf230bb/halbb.c index 178e338ef..c377db10e 100644 --- a/cpu/avr/radio/rf230bb/halbb.c +++ b/cpu/avr/radio/rf230bb/halbb.c @@ -735,26 +735,29 @@ hal_frame_write(uint8_t *write_buffer, uint8_t length) * \param length Length of the read burst * \param data Pointer to buffer where data is stored. */ -//void -//hal_sram_read(uint8_t address, uint8_t length, uint8_t *data) -//{ -// HAL_SPI_TRANSFER_OPEN(); +#if 0 //Uses 80 bytes (on Raven) omit unless needed +void +hal_sram_read(uint8_t address, uint8_t length, uint8_t *data) +{ + HAL_SPI_TRANSFER_OPEN(); - /*Send SRAM read command.*/ -// HAL_SPI_TRANSFER(0x00); + /*Send SRAM read command and address to start*/ + HAL_SPI_TRANSFER(0x00); + HAL_SPI_TRANSFER(address); - /*Send address where to start reading.*/ -// HAL_SPI_TRANSFER(address); + HAL_SPI_TRANSFER_WRITE(0); + HAL_SPI_TRANSFER_WAIT(); /*Upload the chosen memory area.*/ -// do{ -// *data++ = HAL_SPI_TRANSFER(0); -// } while (--length > 0); - -// HAL_SPI_TRANSFER_CLOSE(); - -//} + do{ + *data++ = HAL_SPI_TRANSFER_READ(); + HAL_SPI_TRANSFER_WRITE(0); + HAL_SPI_TRANSFER_WAIT(); + } while (--length > 0); + HAL_SPI_TRANSFER_CLOSE(); +} +#endif /*----------------------------------------------------------------------------*/ /** \brief Write SRAM *