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.`
This commit is contained in:
parent
5b05a34dff
commit
f1df088789
2 changed files with 13 additions and 11 deletions
|
|
@ -62,12 +62,12 @@ Preferences directly supports the following data types:
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| ULong | uint32_t | 4 |
|
| ULong | uint32_t | 4 |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
|
| Float | float_t | 4 |
|
||||||
|
+-------------------+-------------------+---------------+
|
||||||
| Long64 | int64_t | 8 |
|
| Long64 | int64_t | 8 |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| ULong64 | uint64_t | 8 |
|
| ULong64 | uint64_t | 8 |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| Float | float_t | 8 |
|
|
||||||
+-------------------+-------------------+---------------+
|
|
||||||
| Double | double_t | 8 |
|
| Double | double_t | 8 |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| | const char* | variable |
|
| | const char* | variable |
|
||||||
|
|
@ -258,6 +258,8 @@ Arduino-esp32 Preferences API
|
||||||
``putInt, putUInt``
|
``putInt, putUInt``
|
||||||
********************
|
********************
|
||||||
``putLong, putULong``
|
``putLong, putULong``
|
||||||
|
**********************
|
||||||
|
``putFloat``
|
||||||
**********************
|
**********************
|
||||||
|
|
||||||
Store a value against a given key in the currently open namespace.
|
Store a value against a given key in the currently open namespace.
|
||||||
|
|
@ -268,6 +270,7 @@ Arduino-esp32 Preferences API
|
||||||
size_t putUInt(const char* key, uint32_t value)
|
size_t putUInt(const char* key, uint32_t value)
|
||||||
size_t putLong(const char* key, int32_t value)
|
size_t putLong(const char* key, int32_t value)
|
||||||
size_t putULong(const char* key, uint32_t value)
|
size_t putULong(const char* key, uint32_t value)
|
||||||
|
size_t putFloat(const char* key, float_t value)
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
|
|
@ -288,8 +291,8 @@ Arduino-esp32 Preferences API
|
||||||
|
|
||||||
``putLong64, putULong64``
|
``putLong64, putULong64``
|
||||||
*************************
|
*************************
|
||||||
``putFloat, putDouble``
|
``putDouble``
|
||||||
***********************
|
*************************
|
||||||
|
|
||||||
Store a value against a given key in the currently open namespace.
|
Store a value against a given key in the currently open namespace.
|
||||||
|
|
||||||
|
|
@ -297,7 +300,6 @@ Arduino-esp32 Preferences API
|
||||||
|
|
||||||
size_t putLong64(const char* key, int64_t value)
|
size_t putLong64(const char* key, int64_t value)
|
||||||
size_t putULong64(const char* key, uint64_t value)
|
size_t putULong64(const char* key, uint64_t value)
|
||||||
size_t putFloat(const char* key, float_t value)
|
|
||||||
size_t putDouble(const char* key, double_t value)
|
size_t putDouble(const char* key, double_t value)
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
|
||||||
|
|
@ -70,16 +70,16 @@ Preferences directly supports the following data types:
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| ULong | uint32_t | 4 |
|
| ULong | uint32_t | 4 |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
|
| Float | float_t | 4 |
|
||||||
|
+-------------------+-------------------+---------------+
|
||||||
| Long64 | int64_t | 8 |
|
| Long64 | int64_t | 8 |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| ULong64 | uint64_t | 8 |
|
| ULong64 | uint64_t | 8 |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| Float | float_t | 8 |
|
|
||||||
+-------------------+-------------------+---------------+
|
|
||||||
| Double | double_t | 8 |
|
| Double | double_t | 8 |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| | const char* | |
|
| | const char* | variable |
|
||||||
| String +-------------------+ variable |
|
| String +-------------------+ |
|
||||||
| | String | |
|
| | String | |
|
||||||
+-------------------+-------------------+---------------+
|
+-------------------+-------------------+---------------+
|
||||||
| Bytes | uint8_t | variable |
|
| Bytes | uint8_t | variable |
|
||||||
|
|
@ -233,9 +233,9 @@ Like so:
|
||||||
|
|
||||||
.. code-block:: arduino
|
.. code-block:: arduino
|
||||||
|
|
||||||
float myFloat = myPreferences.getFloat("pi");
|
float_t myFloat = myPreferences.getFloat("pi");
|
||||||
|
|
||||||
This will retrieve the float value from the namespace key ``"pi"`` and assign it to the float type variable ``myFloat``.
|
This will retrieve the float_t value from the namespace key ``"pi"`` and assign it to the float_t type variable ``myFloat``.
|
||||||
|
|
||||||
|
|
||||||
Summary
|
Summary
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue