From 4154dae01acfd4f377101858c1b9b9faf0d1fdcd Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 24 May 2020 17:46:43 +0200 Subject: [PATCH] Fix race condition in SpiMaster.cpp. --- src/drivers/SpiMaster.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drivers/SpiMaster.cpp b/src/drivers/SpiMaster.cpp index 18bf336f..ff241184 100644 --- a/src/drivers/SpiMaster.cpp +++ b/src/drivers/SpiMaster.cpp @@ -185,6 +185,8 @@ bool SpiMaster::Write(uint8_t pinCsn, const uint8_t *data, size_t size) { if(size == 1) { while (spiBaseAddress->EVENTS_END == 0); + nrf_gpio_pin_set(this->pinCsn); + currentBufferAddr = 0; xSemaphoreGive(mutex); }