RW shutdown #580

Merged
muellerr merged 6 commits from feature_proper_rw_shutdown into develop 2023-04-07 17:20:31 +02:00
Showing only changes of commit 353b9bd322 - Show all commits

View File

@ -47,15 +47,25 @@ ReturnValue_t RwPollingTask::performOperation(uint8_t operationCode) {
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
continue; continue;
} }
acs::SimpleSensorMode currentMode;
rws::SpecialRwRequest specialRequest;
bool doSetSpeed;
for (unsigned idx = 0; idx < rwCookies.size(); idx++) { for (unsigned idx = 0; idx < rwCookies.size(); idx++) {
if (rwRequests[idx].mode == acs::SimpleSensorMode::OFF) { {
MutexGuard mg(ipcLock);
currentMode = rwRequests[idx].mode;
specialRequest = rwRequests[idx].specialRequest;
doSetSpeed = rwRequests[idx].setSpeed;
}
if (currentMode == acs::SimpleSensorMode::OFF) {
skipCommandingForRw[idx] = true; skipCommandingForRw[idx] = true;
} else if (rwRequests[idx].specialRequest == rws::SpecialRwRequest::RESET_MCU) { } else if (specialRequest == rws::SpecialRwRequest::RESET_MCU) {
prepareSimpleCommand(rws::RESET_MCU); prepareSimpleCommand(rws::RESET_MCU);
// No point in commanding that specific RW for the cycle. // No point in commanding that specific RW for the cycle.
skipCommandingForRw[idx] = true; skipCommandingForRw[idx] = true;
writeOneRwCmd(idx, fd); writeOneRwCmd(idx, fd);
} else if (rwRequests[idx].setSpeed) { } else if (doSetSpeed) {
prepareSetSpeedCmd(idx); prepareSetSpeedCmd(idx);
if (writeOneRwCmd(idx, fd) != returnvalue::OK) { if (writeOneRwCmd(idx, fd) != returnvalue::OK) {
continue; continue;