Skip to content

Document F() macro for placing constant strings in program (flash) memory. #2579

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
damellis opened this issue Jan 26, 2015 · 8 comments
Closed
Assignees
Labels
Component: Documentation Related to Arduino's documentation content
Milestone

Comments

@damellis
Copy link
Contributor

You can use the F() macro to place constants in flash memory, not RAM, e.g. Serial.println(F("foo")) but I didn't find this documented anywhere in the Arduino reference.

@damellis damellis added the Component: Documentation Related to Arduino's documentation content label Jan 26, 2015
@matthijskooijman
Copy link
Collaborator

The use of the __FlashStringHelper* type for storing such constants should probably also be documented.

On a related note, the http://arduino.cc/en/Reference/PROGMEM should also be updated. Since the gcc and libc upgrade in 1.5.7 (IIRC), there is no need to use the prog_* types anymore.

@q2dg
Copy link

q2dg commented Apr 6, 2015

It is documented in http://playground.arduino.cc/Learning/Memory... but it's not an official documentation, I infer. This fact is very inconsistent because while in http://arduino.cc/en/Reference/PROGMEM (official resource) the issue with new PROGMEM way of doing things is updated (see #2647), in http://playground.arduino.cc/Main/PROGMEM is not...so...mmm...

See also #2122

@agdl
Copy link
Member

agdl commented Sep 28, 2015

@q2dg @damellis documentation added for Serial.print(F()) added https://www.arduino.cc/en/Reference/PROGMEM

@matthijskooijman how do you suggest to modify the current documentation?

@agdl agdl added the Waiting for feedback More information must be provided before we can proceed label Sep 28, 2015
@agdl agdl added this to the Release 1.6.6 milestone Sep 28, 2015
@q2dg
Copy link

q2dg commented Sep 28, 2015

  • There's some typo ("istruction" , the comma between "to be printed" and "is normally"...)
  • Maybe behind "PROGMEM is part of the pgmspace.h library" sentence I would specify "which is only available in AVR architecture"
  • The paragraph talking about F() is placed in a nonsense way. It should be better written (with a proper title, like 'The F() macro' or similar) at the end of all text.

@agdl
Copy link
Member

agdl commented Sep 29, 2015

@q2dg modified in the way you suggested

@q2dg
Copy link

q2dg commented Sep 29, 2015

Ok, thanks. For me it's already right

@agdl
Copy link
Member

agdl commented Sep 29, 2015

ok, @matthijskooijman can this be closed?

@agdl
Copy link
Member

agdl commented Oct 7, 2015

I'm closing this, reopen it if necessary

@agdl agdl closed this as completed Oct 7, 2015
@cmaglie cmaglie removed the Waiting for feedback More information must be provided before we can proceed label Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Related to Arduino's documentation content
Projects
None yet
Development

No branches or pull requests

5 participants