diff --git a/linux/acs/RwPollingTask.cpp b/linux/acs/RwPollingTask.cpp index 39bc28b6..32eb24f4 100644 --- a/linux/acs/RwPollingTask.cpp +++ b/linux/acs/RwPollingTask.cpp @@ -49,14 +49,13 @@ ReturnValue_t RwPollingTask::performOperation(uint8_t operationCode) { } acs::SimpleSensorMode currentMode; rws::SpecialRwRequest specialRequest; - bool doSetSpeed; for (unsigned idx = 0; idx < rwCookies.size(); idx++) { { MutexGuard mg(ipcLock); currentMode = rwRequests[idx].mode; specialRequest = rwRequests[idx].specialRequest; - doSetSpeed = rwRequests[idx].setSpeed; + skipSetSpeedReply[idx] = rwRequests[idx].setSpeed; } if (currentMode == acs::SimpleSensorMode::OFF) { skipCommandingForRw[idx] = true; @@ -65,7 +64,7 @@ ReturnValue_t RwPollingTask::performOperation(uint8_t operationCode) { // No point in commanding that specific RW for the cycle. skipCommandingForRw[idx] = true; writeOneRwCmd(idx, fd); - } else if (doSetSpeed) { + } else if (skipSetSpeedReply[idx]) { prepareSetSpeedCmd(idx); if (writeOneRwCmd(idx, fd) != returnvalue::OK) { continue; @@ -329,7 +328,7 @@ ReturnValue_t RwPollingTask::writeOneRwCmd(uint8_t rwIdx, int fd) { ReturnValue_t RwPollingTask::readAllRws(DeviceCommandId_t id) { // SPI dev will be opened in readNextReply on demand. for (unsigned idx = 0; idx < rwCookies.size(); idx++) { - if (((id == rws::SET_SPEED) and !rwRequests[idx].setSpeed) or skipCommandingForRw[idx]) { + if (((id == rws::SET_SPEED) and !skipSetSpeedReply[idx]) or skipCommandingForRw[idx]) { continue; } uint8_t* replyBuf; diff --git a/linux/acs/RwPollingTask.h b/linux/acs/RwPollingTask.h index e43ae46e..f06bc622 100644 --- a/linux/acs/RwPollingTask.h +++ b/linux/acs/RwPollingTask.h @@ -47,6 +47,7 @@ class RwPollingTask : public SystemObject, public ExecutableObjectIF, public Dev const char* spiDev; GpioIF& gpioIF; std::array skipCommandingForRw; + std::array skipSetSpeedReply; std::array specialRequestIds; std::array rwCookies; std::array rwRequests{};