aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authormark9064 <30447455+mark9064@users.noreply.github.com>2024-02-11 14:35:11 +0000
committerJF <JF002@users.noreply.github.com>2024-05-01 16:13:47 +0200
commitee925200c38ef9f04f976ebaf70b17d2898fcec5 (patch)
tree4aaf4add7a16e8e653e47198b922d7fda193c81d /src/drivers
parent079e676baf70a943d31317afde47b759ca69ca2d (diff)
Remove task to notify
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/SpiMaster.cpp16
-rw-r--r--src/drivers/SpiMaster.h1
2 files changed, 3 insertions, 14 deletions
diff --git a/src/drivers/SpiMaster.cpp b/src/drivers/SpiMaster.cpp
index 4c2bc940..f878c7d5 100644
--- a/src/drivers/SpiMaster.cpp
+++ b/src/drivers/SpiMaster.cpp
@@ -136,20 +136,14 @@ void SpiMaster::OnEndEvent() {
spiBaseAddress->TASKS_START = 1;
} else {
- BaseType_t xHigherPriorityTaskWoken = pdFALSE;
- if (taskToNotify != nullptr) {
- vTaskNotifyGiveFromISR(taskToNotify, &xHigherPriorityTaskWoken);
- portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
- }
-
nrf_gpio_pin_set(this->pinCsn);
if (this->TransactionHook != nullptr) {
this->TransactionHook(false);
}
currentBufferAddr = 0;
- BaseType_t xHigherPriorityTaskWoken2 = pdFALSE;
- xSemaphoreGiveFromISR(mutex, &xHigherPriorityTaskWoken2);
- portYIELD_FROM_ISR(xHigherPriorityTaskWoken | xHigherPriorityTaskWoken2);
+ BaseType_t xHigherPriorityTaskWoken = pdFALSE;
+ xSemaphoreGiveFromISR(mutex, &xHigherPriorityTaskWoken);
+ portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
@@ -181,7 +175,6 @@ bool SpiMaster::Write(uint8_t pinCsn, const uint8_t* data, size_t size, void (*T
return false;
auto ok = xSemaphoreTake(mutex, portMAX_DELAY);
ASSERT(ok == true);
- taskToNotify = xTaskGetCurrentTaskHandle();
this->TransactionHook = TransactionHook;
this->pinCsn = pinCsn;
@@ -226,7 +219,6 @@ bool SpiMaster::Write(uint8_t pinCsn, const uint8_t* data, size_t size, void (*T
bool SpiMaster::Read(uint8_t pinCsn, uint8_t* cmd, size_t cmdSize, uint8_t* data, size_t dataSize) {
xSemaphoreTake(mutex, portMAX_DELAY);
- taskToNotify = nullptr;
this->TransactionHook = nullptr;
this->pinCsn = pinCsn;
DisableWorkaroundForFtpan58(spiBaseAddress, 0, 0);
@@ -275,8 +267,6 @@ void SpiMaster::Wakeup() {
bool SpiMaster::WriteCmdAndBuffer(uint8_t pinCsn, const uint8_t* cmd, size_t cmdSize, const uint8_t* data, size_t dataSize) {
xSemaphoreTake(mutex, portMAX_DELAY);
- taskToNotify = nullptr;
-
this->TransactionHook = nullptr;
this->pinCsn = pinCsn;
diff --git a/src/drivers/SpiMaster.h b/src/drivers/SpiMaster.h
index 9014061e..131965e1 100644
--- a/src/drivers/SpiMaster.h
+++ b/src/drivers/SpiMaster.h
@@ -57,7 +57,6 @@ namespace Pinetime {
volatile uint32_t currentBufferAddr = 0;
volatile size_t currentBufferSize = 0;
- volatile TaskHandle_t taskToNotify;
SemaphoreHandle_t mutex = nullptr;
};
}