Closed MCUdude closed 4 years ago
Totally agree on this; would you like to open a PR so I can give the right attribution? Thanks
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.
Correct; probably the right approach is to #undef
F macro after including ArduinoAPI.h and redefine it as no-op
Did this https://github.com/arduino/ArduinoCore-megaavr/commit/a0f6beb55e6c60fdd7baffb306d99c0844377f43 (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.
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.
I'll leave this here: https://github.com/SpenceKonde/megaTinyCore/issues/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.