1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

spi: tx buffer is now const

Tx buffers should not be modified.  This allows passing const data
to the transfer function.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1010 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
stac 2010-07-04 02:21:40 +00:00 committed by stac
parent 548a32f18b
commit c12b7e3fed
2 changed files with 2 additions and 2 deletions

View File

@ -284,7 +284,7 @@ int32_t PIOS_SPI_TransferByte(uint8_t spi, uint8_t b)
* \return -2 if unsupported SPI port selected
* \return -3 if function has been called during an ongoing DMA transfer
*/
int32_t PIOS_SPI_TransferBlock(uint8_t spi, uint8_t *send_buffer, uint8_t *receive_buffer, uint16_t len, void *callback)
int32_t PIOS_SPI_TransferBlock(uint8_t spi, const uint8_t *send_buffer, uint8_t *receive_buffer, uint16_t len, void *callback)
{
struct pios_spi_dev * spi_dev;
DMA_InitTypeDef dma_init;

View File

@ -44,7 +44,7 @@ extern int32_t PIOS_SPI_Init(void);
extern int32_t PIOS_SPI_SetClockSpeed(uint8_t spi, SPIPrescalerTypeDef spi_prescaler);
extern int32_t PIOS_SPI_RC_PinSet(uint8_t spi, uint8_t pin_value);
extern int32_t PIOS_SPI_TransferByte(uint8_t spi, uint8_t b);
extern int32_t PIOS_SPI_TransferBlock(uint8_t spi, uint8_t *send_buffer, uint8_t *receive_buffer, uint16_t len, void *callback);
extern int32_t PIOS_SPI_TransferBlock(uint8_t spi, const uint8_t *send_buffer, uint8_t *receive_buffer, uint16_t len, void *callback);
extern void PIOS_SPI_IRQ_Handler(uint8_t spi);
#endif /* PIOS_SPI_H */