Merge pull request #291 from maikmerten/master

icetime: Parse PCF files with -pullup and -pullup_resistor in set_io directives
This commit is contained in:
Miodrag Milanović 2022-05-30 10:08:40 +02:00 committed by GitHub
commit eaea10ba4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -222,10 +222,20 @@ void read_pcf(const char *filename)
if (tok == nullptr || strcmp(tok, "set_io"))
continue;
bool skip_next = false;
std::vector<std::string> args;
while ((tok = strtok(nullptr, " \t\r\n")) != nullptr) {
if(skip_next) {
skip_next = false;
continue;
}
if (!strcmp(tok, "--warn-no-port"))
continue;
if (!strcmp(tok, "-pullup") || !strcmp(tok, "-pullup_resistor")) {
skip_next = true; // skip argument
continue;
}
args.push_back(tok);
}