From cc38bd8b1714649bdc6caa7e9304f1e469e853e8 Mon Sep 17 00:00:00 2001 From: Folkert van Heusden Date: Wed, 26 Jun 2024 20:51:20 +0200 Subject: [PATCH] race in kw11-l --- kw11-l.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kw11-l.cpp b/kw11-l.cpp index f044f84..863438e 100644 --- a/kw11-l.cpp +++ b/kw11-l.cpp @@ -181,6 +181,11 @@ void kw11_l::write_byte(const uint16_t addr, const uint8_t value) return; } +#if defined(BUILD_FOR_RP2040) + xSemaphoreTake(lf_csr_lock, portMAX_DELAY); +#else + std::unique_lock lck(lf_csr_lock); +#endif uint16_t vtemp = lf_csr; if (addr & 1) {