mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Adds a const buffer listener (#742)
Replaces need for const_cast in SPI and I2C functions
This commit is contained in:
committed by
Peter Johnson
parent
a20474bfc7
commit
cd1dbb1e3a
@@ -32,7 +32,7 @@ class I2CData {
|
||||
int32_t RegisterReadCallback(HAL_BufferCallback callback, void* param);
|
||||
void CancelReadCallback(int32_t uid);
|
||||
|
||||
int32_t RegisterWriteCallback(HAL_BufferCallback callback, void* param);
|
||||
int32_t RegisterWriteCallback(HAL_ConstBufferCallback callback, void* param);
|
||||
void CancelWriteCallback(int32_t uid);
|
||||
|
||||
void Write(int32_t deviceAddress, const uint8_t* dataToSend,
|
||||
@@ -47,7 +47,7 @@ class I2CData {
|
||||
std::atomic<HAL_Bool> m_initialized{false};
|
||||
std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
|
||||
std::shared_ptr<BufferListenerVector> m_readCallbacks = nullptr;
|
||||
std::shared_ptr<BufferListenerVector> m_writeCallbacks = nullptr;
|
||||
std::shared_ptr<ConstBufferListenerVector> m_writeCallbacks = nullptr;
|
||||
};
|
||||
extern I2CData SimI2CData[];
|
||||
} // namespace hal
|
||||
|
||||
Reference in New Issue
Block a user