Fixes for PR 2046 (SPI transaction hooks) (#141)
This commit is contained in:
parent
5ad8c0356e
commit
1fb70a2490
|
@ -1 +1 @@
|
|||
Subproject commit a6cd3679eb1219865a215d0600c9703b198f9157
|
||||
Subproject commit 06c69353156559aa786e8116f2527e8de3ee2d38
|
|
@ -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<void()>& preTransactionHook) {
|
||||
// if (data == nullptr)
|
||||
// return false;
|
||||
// auto ok = xSemaphoreTake(mutex, portMAX_DELAY);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
//#include <semphr.h>
|
||||
|
@ -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<void()>& 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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user