You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hardware/esp8266com/esp8266/doc/reference.md
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,32 @@ Both `Serial` and `Serial1` objects support 5, 6, 7, 8 data bits, odd (O), even
78
78
The Program memory features work much the same way as on a regular Arduino; placing read only data and strings in read only memory and freeing heap for your application.
79
79
The important difference is that on the ESP8266 the literal strings are not pooled. This means that the same literal string defined inside a `F("")` and/or `PSTR("")` will take up space for each instance in the code. So you will need to manage the duplicate strings yourself.
80
80
81
+
There is one additional helper macro to make it easier to pass ```const PROGMEM``` strings to methods that take a ```__FlashStringHelper``` called ```FPSTR()```. The use of this will help make it easier to pool strings.
82
+
Not pooling strings...
83
+
84
+
```С++
85
+
String response1;
86
+
response1 += F("http:");
87
+
...
88
+
String response2;
89
+
response2 += F("http:");
90
+
```
91
+
92
+
using FPSTR would become...
93
+
94
+
```С++
95
+
const char HTTP[] PROGMEM = "http:";
96
+
...
97
+
{
98
+
String response1;
99
+
response1 += FPSTR(HTTP);
100
+
...
101
+
String response2;
102
+
response2 += FPSTR(HTTP);
103
+
}
104
+
```
105
+
106
+
81
107
## WiFi(ESP8266WiFi library)
82
108
83
109
This is mostly similar to WiFi shield library. Differences include:
0 commit comments