From bbdd3c052e31f9270fa037b472bf91ba4eb4288e Mon Sep 17 00:00:00 2001 From: Irini Kosmidou Date: Wed, 13 Apr 2022 17:47:24 +0200 Subject: [PATCH] mutex --- linux/boardtest/UartTestClass.cpp | 2 +- linux/devices/ScexUartReader.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index c2619699..28d92c40 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -23,7 +23,7 @@ UartTestClass::UartTestClass(object_id_t objectId, ScexUartReader* reader) : TestTask(objectId), reader(reader) { mode = TestModes::SCEX; - scexMode = ScexModes::READER_TASK; + scexMode = ScexModes::SIMPLE; currCmd = scex::ScexCmds::FRAM; if (scexMode == ScexModes::SIMPLE) { auto encodingBuf = new std::array; diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index 15201dd1..657fb829 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -170,7 +170,7 @@ void ScexUartReader::foundDlePacketHandler(const DleParser::Context &ctx) { void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { // TODO: insert data into IPC ring buffer here sif::info << "Detected DLE encoded packet with decoded size " << len << std::endl; - //MutexGuard mg(lock); + MutexGuard mg(lock); ReturnValue_t result = ipcQueue.insert(len); if(result != RETURN_OK){ sif::warning<< "IPCQueue error" << std::endl; @@ -184,7 +184,7 @@ void ScexUartReader::handleFoundDlePacket(uint8_t *packet, size_t len) { ReturnValue_t ScexUartReader::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) { - //MutexGuard mg(lock); + MutexGuard mg(lock); if (ipcQueue.empty()) { *size = 0; return RETURN_OK;