Skip to content

Commit f1df088

Browse files
docs: correct Float type size in Preferences API and Tutorial documentation (#10113)
* Correct Float type size Correct in the data type table and the API call the size of the Preferences `Float` type and returned value for `putFloat()`. * Update Float call prototype * Correct Float type size Correct Float type size in the Preferences Types table. Revise text to use `float_t` in place of `float`. * Correct doc build error Correct the `Explicit markup ends without a blank line; unexpected unindent.`
1 parent 5b05a34 commit f1df088

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Diff for: docs/en/api/preferences.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ Preferences directly supports the following data types:
6262
+-------------------+-------------------+---------------+
6363
| ULong | uint32_t | 4 |
6464
+-------------------+-------------------+---------------+
65+
| Float | float_t | 4 |
66+
+-------------------+-------------------+---------------+
6567
| Long64 | int64_t | 8 |
6668
+-------------------+-------------------+---------------+
6769
| ULong64 | uint64_t | 8 |
6870
+-------------------+-------------------+---------------+
69-
| Float | float_t | 8 |
70-
+-------------------+-------------------+---------------+
7171
| Double | double_t | 8 |
7272
+-------------------+-------------------+---------------+
7373
| | const char* | variable |
@@ -258,6 +258,8 @@ Arduino-esp32 Preferences API
258258
``putInt, putUInt``
259259
********************
260260
``putLong, putULong``
261+
**********************
262+
``putFloat``
261263
**********************
262264

263265
Store a value against a given key in the currently open namespace.
@@ -268,6 +270,7 @@ Arduino-esp32 Preferences API
268270
size_t putUInt(const char* key, uint32_t value)
269271
size_t putLong(const char* key, int32_t value)
270272
size_t putULong(const char* key, uint32_t value)
273+
size_t putFloat(const char* key, float_t value)
271274
272275
..
273276
@@ -288,16 +291,15 @@ Arduino-esp32 Preferences API
288291

289292
``putLong64, putULong64``
290293
*************************
291-
``putFloat, putDouble``
292-
***********************
294+
``putDouble``
295+
*************************
293296

294297
Store a value against a given key in the currently open namespace.
295298

296299
.. code-block:: arduino
297300
298301
size_t putLong64(const char* key, int64_t value)
299302
size_t putULong64(const char* key, uint64_t value)
300-
size_t putFloat(const char* key, float_t value)
301303
size_t putDouble(const char* key, double_t value)
302304
303305
..

Diff for: docs/en/tutorials/preferences.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ Preferences directly supports the following data types:
7070
+-------------------+-------------------+---------------+
7171
| ULong | uint32_t | 4 |
7272
+-------------------+-------------------+---------------+
73+
| Float | float_t | 4 |
74+
+-------------------+-------------------+---------------+
7375
| Long64 | int64_t | 8 |
7476
+-------------------+-------------------+---------------+
7577
| ULong64 | uint64_t | 8 |
7678
+-------------------+-------------------+---------------+
77-
| Float | float_t | 8 |
78-
+-------------------+-------------------+---------------+
7979
| Double | double_t | 8 |
8080
+-------------------+-------------------+---------------+
81-
| | const char* | |
82-
| String +-------------------+ variable |
81+
| | const char* | variable |
82+
| String +-------------------+ |
8383
| | String | |
8484
+-------------------+-------------------+---------------+
8585
| Bytes | uint8_t | variable |
@@ -233,9 +233,9 @@ Like so:
233233

234234
.. code-block:: arduino
235235
236-
float myFloat = myPreferences.getFloat("pi");
236+
float_t myFloat = myPreferences.getFloat("pi");
237237
238-
This will retrieve the float value from the namespace key ``"pi"`` and assign it to the float type variable ``myFloat``.
238+
This will retrieve the float_t value from the namespace key ``"pi"`` and assign it to the float_t type variable ``myFloat``.
239239

240240

241241
Summary

0 commit comments

Comments
 (0)