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:
Peter Johnson
2017-11-14 00:00:45 -08:00
parent df7c1389de
commit 6307d41002
11 changed files with 168 additions and 73 deletions

View File

@@ -63,6 +63,9 @@ void SetCanStatusObject(JNIEnv *env, jobject canStatus,
void SetMatchInfoObject(JNIEnv* env, jobject matchStatus,
const HAL_MatchInfo& matchInfo);
void SetAccumulatorResultObject(JNIEnv* env, jobject accumulatorResult,
int64_t value, int64_t count);
} // namespace frc
#endif // HALUTIL_H