mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +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:
parent
548a32f18b
commit
c12b7e3fed
@ -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;
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user