Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ARDUIFINE: global compiler options extracted from ctags parsing#1117

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
d-a-v wants to merge1 commit intoarduino:masterfromd-a-v:arduifine

Conversation

@d-a-v
Copy link
Contributor

@d-a-vd-a-v commentedDec 28, 2020
edited by rsora
Loading

  • The PR has no duplicates (please search among thePull Requests before creating one)
  • The PR followsour contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Example: these lines in the.ino file:

    const char* ARDUIFINE_abc = "MYLIB_BUFFER_LEN=1234";    const char* ARDUIFINE_def = "MYLIB_PARAM";    const char* ARDUINOGLOBAL_ghi = "-DMYLIB2_BUFFER_LEN=1234";    const char* ARDUINOGLOBAL_jkl = "-DMYLIB2_PARAM";

will globally enable the following options in the compiler command line:

        -DMYLIB_BUFFER_LEN=1234 -DMYLIB_PARAM -DMYLIB2_BUFFER_LEN=1234 -DMYLIB2_PARAM

That,including during compilation of the core and libraries.

If they are not otherwise used by the sketch, the symbolsARDUIFINExxx andARDUINOGLOBALyyy are excluded from the final binary at link time.

This PR aims at giving a solution toarduino/Arduino#421
and is maybe related to#846.


arduifine
(the missingM is fixed)

@d-a-v
Copy link
ContributorAuthor

d-a-v commentedDec 28, 2020
edited
Loading

I would have preferred to propose something like

#arduifine BLAH 1

or

#pragma comment("ARDUIFINE: -Dblah")

but that would have required parsing the whole.ino files.
The simpler the better: the ctags parser is already here.

@d-a-v
Copy link
ContributorAuthor

d-a-v commentedJan 4, 2021
edited
Loading

About security, the compiler command line is affected but user is warned in the message console.
Additional parsing can be added to ensure that not too special characters are used in the macro defined by "ARDUIFINE" and "ARDUINOGLOBAL" feature can be disabled if it is considered as too dangerous.
@facchinm this is close tothis comment.

This PR, apart from adding more noise to an old feature request, is another attempt to finally find an answer toarduino/Arduino#421.
Per this PR, I'd like to bring to anyone interested's attention that the feature is needed.
One of the important use-cases is that itallows usersto avoid modifying libraries when some parameters are to be tuned.
(this feature is provided with other IDE able to compile Arduino projects like platformIO or sloeber)

I'm aware that I updated in thelegacy/ directory. Are there specific considerations about this directory that should be known by contributors ?

I will be happy to close this PR if any other way is found to closearduino/Arduino#421 which has been openedfor 8 years. Attempts or explorations are quite numerous, likethis commit(from@facchinm in#421), or one from the link list compiled by@per1234 in#846's OP. I'll also be glad to update this PR until it fits with maintainers idea of what are arduino-cli / arduino-builder.

@d-a-v
Copy link
ContributorAuthor

d-a-v commentedMay 10, 2021
edited
Loading

My opinion is that there are valid use cases for macro-based interfaces [...] but that it is not appropriate to expect normal users to define global macros in order to use a library

@per1234, this change proposal even as a PoC is orthogonal to your above statement.
You make me believe this opinion is close to official Arduino's, in which case I should close this PR :)

#846's title "Provide dedicated sets of "extra flags" properties for platform developersand users" did make me think that it is "legal" to provide such facility to users.

I have indeed two use-cases on widely used arduino libraries:

IMHO It could be a normal use for an Arduino library to need a global define to get some extended behaviour, at no cost when
they are not needed (= without state variable and related code that costs space on small hw).

I would really like clarification on how Arduino plans to address such issues.

edit 24 days later:

@d-a-v
Copy link
ContributorAuthor

closed per#1517 (comment)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@cmagliecmaglie

Labels

type: enhancementProposed improvement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@d-a-v@cmaglie@AlbyIanna@per1234@rsora

[8]ページ先頭

©2009-2025 Movatter.jp