mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
SPI: Provide byte[] JNI interfaces.
This avoids a direct byte buffer allocation on every read/write/transaction for the byte[] variants. Also change spiGetAccumulatorOutput() to directly set the AccumulatorResult object, avoiding a ByteBuffer allocation. Changes HAL SPI interfaces to use const for dataToSend. Fixes #733.
This commit is contained in:
@@ -47,8 +47,9 @@ class SPIData {
|
||||
int64_t GetAccumulatorValue();
|
||||
|
||||
int32_t Read(uint8_t* buffer, int32_t count);
|
||||
int32_t Write(uint8_t* dataToSend, int32_t sendSize);
|
||||
int32_t Transaction(uint8_t* dataToSend, uint8_t* dataReceived, int32_t size);
|
||||
int32_t Write(const uint8_t* dataToSend, int32_t sendSize);
|
||||
int32_t Transaction(const uint8_t* dataToSend, uint8_t* dataReceived,
|
||||
int32_t size);
|
||||
void ResetAccumulator();
|
||||
|
||||
void ResetData();
|
||||
|
||||
Reference in New Issue
Block a user