Skip to content

No need for the F() macro on the the megaavr architecture #53

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

Closed
MCUdude opened this issue Sep 13, 2019 · 5 comments
Closed

No need for the F() macro on the the megaavr architecture #53

MCUdude opened this issue Sep 13, 2019 · 5 comments

Comments

@MCUdude
Copy link
Contributor

MCUdude commented Sep 13, 2019

I'll leave this here:
SpenceKonde/megaTinyCore#81

In short terms, it has no RAM usage benefits, but it wastes flash memory. Should probably be defined as #define F(string_literal) (string_literal) instead.

@facchinm
Copy link
Member

Totally agree on this; would you like to open a PR so I can give the right attribution?
Thanks

@MCUdude
Copy link
Contributor Author

MCUdude commented Sep 16, 2019

Sure, but that PR has to go into the Arduino API repo (String.h IIRC). I thought this repo should be kept architecture-neutral? Because this is very much an architecture relate thing.

@facchinm
Copy link
Member

Correct; probably the right approach is to #undef F macro after including ArduinoAPI.h and redefine it as no-op

@habazut
Copy link

habazut commented Jan 23, 2021

Did this a0f6beb (which reverted the fix) break this again or do you have another solution for the F() Flash Macro which is present in many codes?
Regards,
Harald.

@facchinm
Copy link
Member

Hi @habazut ,
in fact a0f6beb "broke" this again. We couldn't come up with a clever solution that fits all the situations.
Anyway, in the process we added a bunch of F() relates examples to the CI, just to make sure we are not breaking anyone's sketch again, so if you have any proposal just file a PR and it will be checked against all corner cases.

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