Adds a const buffer listener (#742)

Replaces need for const_cast in SPI and I2C functions
This commit is contained in:
Thad House
2017-11-17 10:01:49 -08:00
committed by Peter Johnson
parent a20474bfc7
commit cd1dbb1e3a
10 changed files with 55 additions and 10 deletions

View File

@@ -32,7 +32,7 @@ class SPIData {
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);
int32_t RegisterResetAccumulatorCallback(HAL_NotifyCallback callback,
@@ -61,7 +61,7 @@ class SPIData {
std::atomic<int64_t> m_accumulatorValue{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;
std::shared_ptr<NotifyListenerVector> m_resetAccumulatorCallback = nullptr;
std::shared_ptr<NotifyListenerVector> m_setAccumulatorCallback = nullptr;
};