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
It would be nice to have the ability to store floats into NVRAM. It's not that hard to do using type punning. This is able to be achieved partly by the user with the get and set but the missing component is the NVS_TYPE when pulling the info for that key. You would not be able to identify it as a float via the info. It would end up being a U32 type.
Describe the solution you'd like.
From what I am seeing this is what would need to be done.
nvs.h
typedefenum {
NVS_TYPE_U8=0x01, /*!< Type uint8_t */NVS_TYPE_I8=0x11, /*!< Type int8_t */NVS_TYPE_U16=0x02, /*!< Type uint16_t */NVS_TYPE_I16=0x12, /*!< Type int16_t */NVS_TYPE_U32=0x04, /*!< Type uint32_t */NVS_TYPE_I32=0x14, /*!< Type int32_t */NVS_TYPE_U64=0x08, /*!< Type uint64_t */NVS_TYPE_I64=0x18, /*!< Type int64_t */NVS_TYPE_STR=0x21, /*!< Type string */NVS_TYPE_BLOB=0x42, /*!< Type blob */NVS_TYPE_FLOAT=0x24, /*!< Type float */NVS_TYPE_ANY=0xff/*!< Must be last */
} nvs_type_t;
esp_err_tnvs_get_float (nvs_handle_thandle, constchar*key, float*value);
esp_err_tnvs_set_float(nvs_handle_tc_handle, constchar*key, floatvalue);
Is your feature request related to a problem?
It would be nice to have the ability to store floats into NVRAM. It's not that hard to do using type punning. This is able to be achieved partly by the user with the get and set but the missing component is the
NVS_TYPE
when pulling the info for that key. You would not be able to identify it as afloat
via the info. It would end up being aU32
type.Describe the solution you'd like.
From what I am seeing this is what would need to be done.
nvs.h
nvs_api.cpp
nvs_handle.hpp
nvs_handle_locked.cpp
nvs_handle_simple.cpp
I could be missing some thing. C and CPP is not my strong language. It would however be nice to see this ability added to the esp-idf
Describe alternatives you've considered.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered: