Is there any reason to specify F() all the time with string literals, especially inside method calls for some classes? I personally do not see any. There is some minor speed difference, which are in this case marginal.
Currently, specifying F("...") free some SRAM which is allocated otherwise in temp variable. I would suggest simply to force C/C++ preprocessor to do that automatically for us (to assume/put F() around literals), or perhaps better even to have some directive for that.
I can see quite a lot waste of SRAM in novice codes, especially for mega8/16/168/328p that may be crucial feature, as well code would be much readable. That may sound minor for few lines of text, however if there is more than 20 (device for some equipment testing, etc), that may be quite demanding, especially if someone else wrote the code.
For instance: LCD, Serial and other libraries allow string literals.
void setup() {
Serial.begin(115200);
Serial.println("Testing for ATmegaMath2560");
for (int i = 0; i < 128; i++) {
Serial.print("Test line ");
Serial.println(i);
}
}
void loop() {}
Sketch uses 1,982 bytes (0%) of program storage space. Maximum is 253,952 bytes.
Global variables use 224 bytes (2%) of dynamic memory, leaving 7,968 bytes for local variables. Maximum is 8,192 bytes.
void setup() {
Serial.begin(115200);
Serial.println(F("Testing for ATmegaMath2560"));
for (int i = 0; i < 128; i++) {
Serial.print(F("Test line "));
Serial.println(i);
}
}
void loop() {}
Sketch uses 2,048 bytes (0%) of program storage space. Maximum is 253,952 bytes.
Global variables use 186 bytes (2%) of dynamic memory, leaving 8,006 bytes for local variables. Maximum is 8,192 bytes.