Update IDF Libs

This commit is contained in:
me-no-dev
2020-06-28 15:38:58 +03:00
parent 7611f483ae
commit 47b34df897
259 changed files with 1671 additions and 836 deletions

View File

@ -61,6 +61,20 @@ esp_err_t nvs_flash_init(void);
*/
esp_err_t nvs_flash_init_partition(const char *partition_label);
/**
* @brief Initialize NVS flash storage for the partition specified by partition pointer.
*
* @param[in] partition pointer to a partition obtained by the ESP partition API.
*
* @return
* - ESP_OK if storage was successfully initialized
* - ESP_ERR_NVS_NO_FREE_PAGES if the NVS storage contains no empty pages
* (which may happen if NVS partition was truncated)
* - ESP_ERR_INVALID_ARG in case partition is NULL
* - one of the error codes from the underlying flash storage driver
*/
esp_err_t nvs_flash_init_partition_ptr(const esp_partition_t *partition);
/**
* @brief Deinitialize NVS storage for the default NVS partition
*
@ -118,6 +132,26 @@ esp_err_t nvs_flash_erase(void);
*/
esp_err_t nvs_flash_erase_partition(const char *part_name);
/**
* @brief Erase custom partition.
*
* Erase all content of specified custom partition.
*
* @note
* If the partition is initialized, this function first de-initializes it.
* Afterwards, the partition has to be initialized again to be used.
*
* @param[in] partition pointer to a partition obtained by the ESP partition API.
*
* @return
* - ESP_OK on success
* - ESP_ERR_NOT_FOUND if there is no partition with the specified
* parameters in the partition table
* - ESP_ERR_INVALID_ARG in case partition is NULL
* - one of the error codes from the underlying flash storage driver
*/
esp_err_t nvs_flash_erase_partition_ptr(const esp_partition_t *partition);
/**
* @brief Initialize the default NVS partition.
*

View File

@ -47,9 +47,11 @@ public:
* @param[in] key Key name. Maximal length is determined by the underlying
* implementation, but is guaranteed to be at least
* 15 characters. Shouldn't be empty.
* @param[in] value The value to set. Allowed types are the ones declared in ItemType.
* @param[in] value The value to set. Allowed types are the ones declared in ItemType as well as enums.
* For strings, the maximum length (including null character) is
* 4000 bytes.
* Note that enums loose their type information when stored in NVS. Ensure that the correct
* enum type is used during retrieval with \ref get_item!
*
* @return
* - ESP_OK if value was set successfully
@ -80,7 +82,9 @@ public:
* @param[in] key Key name. Maximal length is determined by the underlying
* implementation, but is guaranteed to be at least
* 15 characters. Shouldn't be empty.
* @param value The output value.
* @param value The output value. All integral types which are declared in ItemType as well as enums
* are allowed. Note however that enums lost their type information when stored in NVS.
* Ensure that the correct enum type is used during retrieval with \ref get_item!
*
* @return
* - ESP_OK if the value was retrieved successfully
@ -233,12 +237,24 @@ std::unique_ptr<NVSHandle> open_nvs_handle(const char *ns_name,
esp_err_t *err = nullptr);
// Helper functions for template usage
/**
* Help to translate all integral types into ItemType.
*/
template<typename T, typename std::enable_if<std::is_integral<T>::value, void*>::type = nullptr>
constexpr ItemType itemTypeOf()
{
return static_cast<ItemType>(((std::is_signed<T>::value)?0x10:0x00) | sizeof(T));
}
/**
* Help to translate all enum types into integral ItemType.
*/
template<typename T, typename std::enable_if<std::is_enum<T>::value, int>::type = 0>
constexpr ItemType itemTypeOf()
{
return static_cast<ItemType>(((std::is_signed<T>::value)?0x10:0x00) | sizeof(T));
}
template<typename T>
constexpr ItemType itemTypeOf(const T&)
{