Skip to content

Deactivate USB-Core via -D definition #163

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

Open
NicoHood opened this issue Aug 14, 2015 · 4 comments
Open

Deactivate USB-Core via -D definition #163

NicoHood opened this issue Aug 14, 2015 · 4 comments
Assignees

Comments

@NicoHood
Copy link
Contributor

I want to deactivate the USB core of Arduino. Therefore USBCON needs to be undefined. Passing options with -D works, -U not.

2nd issue related to this: the USB-Core should not rely on such a USBCON definition, there should be a wrapper

cc @facchinm

@matthijskooijman
Copy link
Collaborator

@NicoHood AFAIU, -U only undefines things previously defined with -D on the same commandline, it does not prevent #defining them in the source. To support what you need, you would need an #ifnded NO_USB (or something better named) in the source.

@NicoHood NicoHood changed the title build.extra_flags -U undef option not working Deactivate USB-Core via -D definition Aug 15, 2015
@NicoHood
Copy link
Contributor Author

Okay so I changed the issue.

We could:

  • integrate a #ifndef NO_USB_CORE as you said
  • or we could make the whole USB-Core a library which can be included.

2nd option would save us any compiler flags and new boards.txt submenus.
cc @facchinm

@matthijskooijman
Copy link
Collaborator

Problem with the second option is that any existing sketches will break, since they won't have the right include...

@NicoHood
Copy link
Contributor Author

See the PR I referenced. This would solve it properly.

The only question is if we should add a workaround or update the bootloader.

@sandeepmistry sandeepmistry transferred this issue from arduino/Arduino Sep 16, 2019
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

No branches or pull requests

3 participants