Skip to content

Commit

Permalink
Merge pull request #65 from cescalara/add-self-periodic-trigger
Browse files Browse the repository at this point in the history
Fix bug in compound triggers
  • Loading branch information
cescalara authored May 8, 2019
2 parents 7d882cd + 0a9cfab commit d2a7dc9
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions CPU/CPUsoftware/src/tools/InputParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,37 +279,37 @@ CmdLineInputs * InputParser::ParseCmdLineInputs() {
this->CmdLine->zynq_mode = ZynqManager::TA_TRIGGER;
}
else {
std::cout << "Error: for -zynq option the mode could not be identified, use mecontrol -help to check the available modes" << std::endl;
return NULL;
}

/* compound modes */
uint8_t mode_to_set = 0;
size_t found = mode.find(",");

/* compound modes */
uint8_t mode_to_set = 0;
size_t found = mode.find(",");
if (found != std::string::npos) {
found = mode.find("periodic");
if (found != std::string::npos) {
mode_to_set += ZynqManager::PERIODIC;
}
found = mode.find("self");
if (found != std::string::npos) {
mode_to_set += ZynqManager::SELF;
}
found = mode.find("immediate");
if (found != std::string::npos) {
mode_to_set += ZynqManager::IMMEDIATE;
}
found = mode.find("external");
if (found != std::string::npos) {
mode_to_set += ZynqManager::EXTERNAL;
found = mode.find("periodic");
if (found != std::string::npos) {
mode_to_set += ZynqManager::PERIODIC;
}
found = mode.find("self");
if (found != std::string::npos) {
mode_to_set += ZynqManager::SELF;
}
found = mode.find("immediate");
if (found != std::string::npos) {
mode_to_set += ZynqManager::IMMEDIATE;
}
found = mode.find("external");
if (found != std::string::npos) {
mode_to_set += ZynqManager::EXTERNAL;
}
}
else {
std::cout << "Error: for -zynq option the mode could not be identified, use mecontrol -help to check the available modes" << std::endl;
std::cout << "Error: for -zynq option the mode could not be identified, use mecontrol -help to check the available modes" << std::endl;
return NULL;
}
this->CmdLine->zynq_mode = mode_to_set;

}

/* set zynq_mode_string */
this->CmdLine->zynq_mode_string = mode;

Expand Down

0 comments on commit d2a7dc9

Please sign in to comment.