diff options
author | Jean-François Milants <jf@codingfield.com> | 2021-06-10 21:20:27 +0200 |
---|---|---|
committer | Jean-François Milants <jf@codingfield.com> | 2021-06-10 21:20:27 +0200 |
commit | b1925ff28638dd4b8400c4d0c49d796d8990b1af (patch) | |
tree | af4bb0744ae1819ae53c73865fc74d46e2dbefd1 /src/drivers/SpiMaster.cpp | |
parent | caca6a5cff0025df80241a09baab28e49720ddf8 (diff) |
Minor improvements: use std::make_unique when creating unique_ptr, check the code is running from an IRQ before calling xQueueSendFromISR or xQueueSend)
Diffstat (limited to 'src/drivers/SpiMaster.cpp')
-rw-r--r-- | src/drivers/SpiMaster.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/SpiMaster.cpp b/src/drivers/SpiMaster.cpp index 34fcc08a..e2be5027 100644 --- a/src/drivers/SpiMaster.cpp +++ b/src/drivers/SpiMaster.cpp @@ -132,17 +132,17 @@ void SpiMaster::OnEndEvent() { spiBaseAddress->TASKS_START = 1; } else { + BaseType_t xHigherPriorityTaskWoken = pdFALSE; if (taskToNotify != nullptr) { - BaseType_t xHigherPriorityTaskWoken = pdFALSE; vTaskNotifyGiveFromISR(taskToNotify, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } nrf_gpio_pin_set(this->pinCsn); currentBufferAddr = 0; - BaseType_t xHigherPriorityTaskWoken = pdFALSE; - xSemaphoreGiveFromISR(mutex, &xHigherPriorityTaskWoken); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); + BaseType_t xHigherPriorityTaskWoken2 = pdFALSE; + xSemaphoreGiveFromISR(mutex, &xHigherPriorityTaskWoken2); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken | xHigherPriorityTaskWoken2); } } |