Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PULLMODE=NONE to lpf generation #771

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

antoinevg
Copy link
Contributor

At present the compiler only supports the generation of lpf files containing pin attributes of: PULLMODE=UP and PULLMODE=DOWN.

This PR cleans up the code for generating pull modes as well as adding support for generating PULLMODE=NONE from a pinout.json file such as:

{"type": "input",  "name": "button_user", "value": "M14", "pullmode" : "NONE"},

The original implemenation also had a bug whereby pins without a pullmode property would be assigned a pullmode of NONE:

pullmode = (typeof pullmode === 'undefined') ? 'NONE' : pullmode;

This is incorrect as the default pull mode for a lpf file with no pull mode attribute is DOWN.

However this did not cause any problems in practice due to the conditional below it which would only generate a PULLMODE attribute for UP and DOWN:

if (pullmode === 'UP' || pullmode === 'DOWN') {
  code += 'PULLMODE=' + pullmode;
}

@Obijuan Obijuan merged commit d46fc82 into FPGAwars:develop Oct 7, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants