diff --git a/sim/drivers/SpiMaster.cpp b/sim/drivers/SpiMaster.cpp index 92e7ab2..e9d9473 100644 --- a/sim/drivers/SpiMaster.cpp +++ b/sim/drivers/SpiMaster.cpp @@ -176,7 +176,7 @@ void SpiMaster::OnStartedEvent() { // spiBaseAddress->EVENTS_END = 0; //} -bool SpiMaster::Write(uint8_t pinCsn, const uint8_t* data, size_t size) { +bool SpiMaster::Write(uint8_t pinCsn, const uint8_t* data, size_t size, const std::function& preTransactionHook) { // if (data == nullptr) // return false; // auto ok = xSemaphoreTake(mutex, portMAX_DELAY); diff --git a/sim/drivers/SpiMaster.h b/sim/drivers/SpiMaster.h index 14ba2d2..4e53492 100644 --- a/sim/drivers/SpiMaster.h +++ b/sim/drivers/SpiMaster.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include //#include @@ -30,7 +31,7 @@ namespace Pinetime { SpiMaster& operator=(SpiMaster&&) = delete; bool Init(); - bool Write(uint8_t pinCsn, const uint8_t* data, size_t size); + bool Write(uint8_t pinCsn, const uint8_t* data, size_t size, const std::function& preTransactionHook); bool Read(uint8_t pinCsn, uint8_t* cmd, size_t cmdSize, uint8_t* data, size_t dataSize); bool WriteCmdAndBuffer(uint8_t pinCsn, const uint8_t* cmd, size_t cmdSize, const uint8_t* data, size_t dataSize);